i want to run this bash code every minute using cron. I saved it onto /root/activate.sh
#!/bin/bash
for file in /home/user/torrents/*.torrent
do
if [ "$file" != "/home/user/torrents/*.torrent" ]; then
echo [`date`] "$file" added to queue. >> /var/log/torrentwatch.log
/usr/bin/transmission-remote localhost:9091 -a "$file"
mv "$file" "$file".added
sleep 1
fi
done
permission is set -rwxrwxrwx 1 root root 278 May 27 01:27 activate.sh
then inside my crontab -e
i placed this
* * * * * root sh /root/activate.sh
the script does not execute and i get this log error
May 27 01:40:02 media CRON[3556]: (root) CMD (root sh /root/activate.sh)
May 27 01:40:02 media CRON[3555]: (CRON) info (No MTA installed, discarding output)
---after a minute---
May 27 01:41:01 media CRON[3582]: (root) CMD (root sh /root/activate.sh)
May 27 01:41:01 media CRON[3581]: (CRON) info (No MTA installed, discarding output)