3

I noticed that my script is probably running in a wrong time (UTC maybe?). But I've added CRON_TZ into the crontab.

EDIT


It's Ubuntu 18.04, DigitalOcean.com droplet which was created from snapshot.


I've checked syntax and it is correct I think. Do you know where could be the problem?

CRON_TZ='Europe/Prague'
53 12 * * * touch /home/futilestudio/feedproject/cronsupervisor/scripts/touch0.txt

The script should be executed 12:53 Slovakia/Czech Republic time (in 24 hour format) but it wasn't - it haven't created a touch0.txt. If I execute it manually it works.

CONFIRMED

I tried to put there a command in UTC and it created a file (SK/CZ is 13:24 but UTC is 11:24 right now)

24 11 * * * touch /home/futilestudio/feedproject/cronsupervisor/scripts/touch0.txt

EDIT

It's 14:20 Prague time and I've set two jobs:

21 12 * * * TZ=Europe/Prague touch /home/futilestudio/feedproject/cronsupervisor/scripts/touch0.txt
21 14 * * * TZ=Europe/Prague touch /home/futilestudio/feedproject/cronsupervisor/scripts/touch1.txt

and removed touch0.txt from the directory.

14:21 - created /home/futilestudio/feedproject/cronsupervisor/scripts/touch0.txt

Milano
  • 643
  • 3
  • 12
  • 24

1 Answers1

0

What about setting both CRON_TZ and TZ?

SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=me

CRON_TZ='Europe/Prague'

TZ='Europe/Prague'

53 12 * * * touch /home/futilestudio/feedproject/cronsupervisor/scripts/touch0.txt

sgrf
  • 1