0

I added a job for backup to my cron jobs, using crontab -e:

0 0 * * * tar -czf /somewhere/backup.tar.gz --exclude='sth/backup' --directory='/var/www' sth

But when I check the created file, with stat, it shows this:

Access: 2015-08-26 11:55:48.000667280 +0430
Modify: 2015-09-03 08:30:07.946818661 +0430
Change: 2015-09-03 08:30:07.946818661 +0430

As you see, the modification time of the file is 08:30. But in the crontab, I have set this to execute on 00:00 (12 at midnight).

Why is this happening?

Ahmad
  • 133
  • 10

1 Answers1

0

The problem was originating from that I had changed the server's timezone a long time ago, but because I did not restart my server for several months, the changes did not apply to the cron service.

The main point is you have to restart the cron service after changing the timezone in order to take effect.

Ahmad
  • 133
  • 10