Hi
I'm running some cronjob on my sheevaplug but one of them doesn't work. My crontab is:
# m h dom mon dow command
@hourly /flexget/flexget.py -q
*/10 * * * * /flexget/watchdog.sh
@hourly gpodder -r
The script i have problems with is watchdog, when i run it from the commandline it works fine, but as a cronjob it doesn't work. The content of the script is:
#!/bin/bash
# Watch dir, may contain spaces:
watchdir="/mnt/mybook/Torrent/torrentfiler/showrss/"
# move file to a subdirectory? if Commented out, it'll removed remove
# the torrent file.
# Note: Don't put a '/' before the path!
movesubdir="added/"
# Authentication "username:password":
tr_auth="brugernavn:kodeord"
# Transmission host "ip:port":
tr_host="127.0.0.1:9091"
# Verbose?
verbose=1
#############################################
time=$(date "+%Y-%m-%d (%H:%M:%S)")
if [ -n "$tr_auth" ]; then
tr_auth="--auth=$tr_auth"
fi
for file in "$watchdir"*.torrent
do
if [ -f "$file" ]; then
if [ -n "$verbose" ]; then echo "$time: $file added to queue."; fi
/usr/bin/transmission-remote "$tr_host" "$tr_auth" -a "$file" > /dev/null
# give the remote some time to process
sleep 5
if [ $movesubdir ]; then
if [ -d "$watchdir$movesubdir" ]; then
mv "$file" "$watchdir$movesubdir"
else
mkdir "$watchdir$movesubdir"
mv "$file" "$watchdir$movesubdir"
fi
else
rm "$file"
fi
else
if [ -n "$verbose" ]; then echo "$time: No torrent in $watchdir."; fi
fi
done
exit 0
Hope you can help
