asked on
$ crontab -l | grep /backup
30 1 * * tue-sat /bin/bash -c "/root/backup >>/root/logfiles/backup.log 2>&1"
Clearly, it shows running at 1:30AM. Yet starting on Wednesday it began running at 3:30AM (log file):BACKUP STARTED Wed Jul 1 01:30:02 EDT 2015
BACKUP STARTED Thu Jul 2 01:30:01 EDT 2015
BACKUP STARTED Fri Jul 3 01:30:01 EDT 2015
BACKUP STARTED Sat Jul 4 01:30:01 EDT 2015
BACKUP STARTED Tue Jul 7 01:30:01 EDT 2015
BACKUP STARTED Wed Jul 8 01:30:01 EDT 2015
BACKUP STARTED Thu Jul 9 01:30:01 EDT 2015
BACKUP STARTED Fri Jul 10 01:30:01 EDT 2015
BACKUP STARTED Sat Jul 11 01:30:01 EDT 2015
BACKUP STARTED Tue Jul 14 01:30:01 EDT 2015
BACKUP STARTED Wed Jul 15 03:30:01 EDT 2015
BACKUP STARTED Thu Jul 16 03:30:01 EDT 2015
BACKUP STARTED Fri Jul 17 03:30:01 EDT 2015
Friday (today), after 1:30AM I deleted and reloaded the crontab keeping the 1:30 time, but adding a line to run at 1:55. It did not run at 1:55. I removed the 1:55 line and reloaded crontab, but it still ran at 3:30. Note that nothing is in the /var/log/cron file indicating an error running at 1:30 (or 1:55).ASKER
> ntpq -np
remote refid st t when poll reach delay offset jitter
==============================================================================
*192.168.0.2 173.44.32.10 3 u 1076 1024 377 0.178 -0.243 0.189
+97.107.129.217 200.98.196.212 2 u 708 1024 337 30.206 4.005 0.941
127.127.1.0 .LOCL. 10 l 75h 64 0 0.000 0.000 0.000
arnold: Nothing in /var/log/cron related to this job$ ls -l /etc/localtime
-rw-r--r-- 1 root root 3519 2015-06-04 15:57 /etc/localtime
$ find /usr/share/zoneinfo -size 3519c -exec ls -l \{\} \;
-rw-r--r-- 3 root root 3519 Sep 15 2013 /usr/share/zoneinfo/posixrules
-rw-r--r-- 3 root root 3519 Sep 15 2013 /usr/share/zoneinfo/America/New_York
-rw-r--r-- 3 root root 3519 Sep 15 2013 /usr/share/zoneinfo/US/Eastern
-rw-r--r-- 2 root root 3519 Sep 15 2013 /usr/share/zoneinfo/posix/America/New_York
-rw-r--r-- 2 root root 3519 Sep 15 2013 /usr/share/zoneinfo/posix/US/Eastern
$ date
Fri Jul 17 16:30:03 EDT 2015 # Matches time and zone
Looks like the timezone is set correctly.What is the content of that backup script, the part that is creating the log entry?
#!/bin/bash
export notify=obfuscated@ohprs.org
echo -e "\n==================================="
echo -n "BACKUP STARTED "
start=`date`
echo "$start"
I think there is something wrong with cron for this user (root). Other crons for other users are running at the correct time.
ASKER
ASKER
Try adding this this,Tried something similar:
29 1 * * tue-sat /bin/echo Cron task `/bin/date` >> /root/logfiles/backup.log
While your localtime is set to US/EASTERN, your cron is running a different time zone.Don't think so. cron jobs that were in the crontab for this and other users as of between 2:00AM and 3:30AM Wednesday continue to run and do so at the specified system time.
> ps -ef | grep crond | grep -v grep
root 1003 1 0 Jul14 ? 00:00:03 /usr/sbin/crond -l notice -m sysadmin
Not sure what the date is, but interesting that it is Jul14, before I noticed this problem.ASKER
ASKER
Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.
TRUSTED BY
You could also check the hwclock ( hwclock --systohc)