Cron Jobs issue (/etc/crontab)

Hello Team,

I set the remote storage VPS and when I enter the
[root@server ~]# python /usr/local/CyberCP/plogical/backupSchedule.py

The remote storage VPS can get one .tar file.

But I tried to set the specific TIME (22:10 p.m.) on (/etc/crontab) file, but no any response =(

10 22 * * 0-6 python /usr/local/CyberCP/plogical/backupSchedule.py

But when I set

        • 0-6 python /usr/local/CyberCP/plogical/backupSchedule.py

I can receive the .tar file per min on the remote storage VPS.

Thank you for your help

I also tried this one, but also no response. Thanks!

10 22 * * 0-6 root python /usr/local/CyberCP/plogical/backupSchedule.py

Are you having any problems running python /usr/local/CyberCP/plogical/backupSchedule.py from command line? If no, then you need to setup your cron properly.

Hello Team,

No problem when I run “python /usr/local/CyberCP/plogical/backupSchedule.py” on SSH, but when I set the specific time on (/etc/crontab), the cron jobs is not running.

May I know what’s the meaning of setup cron properly?

Many thanks :slight_smile:

Try https://crontab.guru/

Hello Team,

I based and copy and paste the " 40 3 * * * " to the (/etc/crontab) file, but also not work.

May I know do it have re-build or re-install the cron jobs command?

Thank you very much!

##############################################################

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

For details see man 4 crontabs

Example of job definition:

.---------------- minute (0 - 59)

| .------------- hour (0 - 23)

| | .---------- day of month (1 - 31)

| | | .------- month (1 - 12) OR jan,feb,mar,apr …

| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

| | | | |

* * * * * user-name command to be executed

0 * * * * root python /usr/local/CyberCP/plogical/findBWUsage.py
0 * * * * root /usr/local/CyberCP/postfixSenderPolicy/client.py hourlyCleanup
0 0 1 * * root /usr/local/CyberCP/postfixSenderPolicy/client.py monthlyCleanup
40 3 * * * root python /usr/local/CyberCP/plogical/backupSchedule.py

Wait for your cronjob to run.

Hello Team,

40 3 * * * root python /usr/local/CyberCP/plogical/backupSchedule.py

I saw this morning 10:40 am (Hong Kong time zone) to auto upload the .tar to remote storage VPS.

May I know the CyberPanel cron jobs is it based on UTC time zone? And my VPS server is set to Hong Kong time zone.
Also, may I know can I change the .tar file name and saving path? (Now is on /home/backup/123.123.123.11/Fri-Mar/backup-carriew-07-20-41-Fri-Mar-2019.tar.gz)

Thanks so much!

Yup, cron must have ran when its time came.

Yup, cron must have ran when its time came.

Thank you very much :wink: