March 20, 201214 yr trying to put in a simple unrar script on my unraid server. #!/bin/bash # # Script to unpack tv downloads using unrar. # assumed that tv downloads are in their own directory. # # LOG_DIR="/mnt/cache/.torrents/log" LOG_FILE="unrarscript.log" TMPLOG="$(mktemp)" || return echo -e "---------------------------------------------------------------------------" > $TMPLOG # restart temp log file. echo -e "[ `date` ] Post download Script started..." >> $TMPLOG echo -e "<BR>" >> $TMPLOG echo -e "Extracting tv shows from archives..." >> $TMPLOG cd /mnt/cache/.torrents/downloads/tv # execute unrar command. unrar e -r -o- *.rar >> $TMPLOG echo -e "[ `date` ] Post download Script complete." >> $TMPLOG echo -e "---------------------------------------------------------------------------" >> $TMPLOG # complete log file. # Mail $TMPLOG to root mail -s "Subject: UnRAR" root < $TMPLOG # Append temp log to log file echo $TMPLOG >> /mnt/cache/.torrents/log/tvunrarlog.log returns bad method ^M errors. using ViM editor.
March 23, 201214 yr in the editor, type :set list then delete the carriage-returns you have at the ends of the lines and save the file. (they will be visible as "^M")
Archived
This topic is now archived and is closed to further replies.