Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Re: cron.d execution problem
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-02-15
10:33 AM
2013-02-15
10:33 AM
cron.d execution problem
Hello all,
I read another forum post here: viewtopic.php?f=35&t=47288
I have a file "remote_backup_maintenance" in /etc/cron.d with these contents:
I have an extra blank line at the end of the file.
I have remote_backup_maintenance.sh in /etc/frontview/addons/bin/REMOTE_BACKUP/ with contents:
I can run the following at the command line:
It executes fine and I get an email.
However, it doesn't appear that the cron job is executing. I've tried each seperately and one after the other:
and
Any ideas why this cron job isn't running?
Thanks!
I read another forum post here: viewtopic.php?f=35&t=47288
I have a file "remote_backup_maintenance" in /etc/cron.d with these contents:
30 13 * * * root /etc/frontview/addons/bin/REMOTE_BACKUP/remote_backup_maintenance.sh
I have an extra blank line at the end of the file.
I have remote_backup_maintenance.sh in /etc/frontview/addons/bin/REMOTE_BACKUP/ with contents:
#!/bin/bash
# email results of maintenance daily via /etc/cron/remote_backup_maintenance
# variables
EMAILMESSAGE="/tmp/remote_backup_maintenance.txt"
# Build mail formatted file
echo "date: `date +%Y-%m-%d`" > $EMAILMESSAGE
echo "to: name@name.com" >> $EMAILMESSAGE
echo "subject: NAS Remote Backup Maintenance `date +%Y-%m-%d`" >> $EMAILMESSAGE
echo "from: name@name.com" >> $EMAILMESSAGE
# The message body
echo "Greetings!" >> $EMAILMESSAGE
echo -e "\nThe backup maintenance script ran with the following results:" >> $EMAILMESSAGE
echo -e "\nDeleted:" >> $EMAILMESSAGE
ls -t /c/remote_backup/backup* | sed -e '1,7d' >> $EMAILMESSAGE
ls -t /c/remote_backup/backup* | sed -e '1,7d' | xargs -d '\n' rm
echo -e "\n\nCurrent inmotion backups:" >> $EMAILMESSAGE
ls -la /c/remote_backup/backup* >> $EMAILMESSAGE
echo -e "\nFinished cleanup @ `date +%H:%M:%S`.\n\nHave a great day!" >> $EMAILMESSAGE
echo "." >> $EMAILMESSAGE
# Send the email -->use -v below for debugging!
/usr/sbin/sendmail -f"name@name.com" "name@name.com" < $EMAILMESSAGE
I can run the following at the command line:
bash /etc/frontview/addons/bin/REMOTE_BACKUP/remote_backup_maintenance.sh
It executes fine and I get an email.
However, it doesn't appear that the cron job is executing. I've tried each seperately and one after the other:
/etc/init.d/cron force-reload
and
/etc/init.d/cron restart
Any ideas why this cron job isn't running?
Thanks!
Message 1 of 2
Labels:
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-02-16
07:32 AM
2013-02-16
07:32 AM
Re: cron.d execution problem
Strange behavior! I got this to work for me yesterday afternoon with the exact steps above, just adjusting the time to be 10-15min ahead of current time. I thought I had this set, then I set it to a time that should have triggered this morning, and nothing! What the heck????
I would love to hear if someone has ideas!
Thanks.
I would love to hear if someone has ideas!
Thanks.
Message 2 of 2