#1 2019-07-16 07:23:12

mbosshard
Member
Registered: 2018-07-17
Posts: 15

cronjob

Hello

I go crazy with the cronjobs i have some jobs that run simultaneously even though i configure the root-rontab right

Here my settings:
/var/spool/cron/crontabs/root

0 19 * * 1-6 "/vmfs/volumes/datastore1/xsi-dir/jobs/003" # Added by XSIBackup
0 19 * * 7 "/vmfs/volumes/datastore1/xsi-dir/jobs/002" # Added by XSIBackup

**/xsi-dir/conf/root-crontab

0 19 * * 1-6 "/vmfs/volumes/datastore1/xsi-dir/jobs/003"
0 19 * * 7 "/vmfs/volumes/datastore1/xsi-dir/jobs/002"

**/xsi-dir/jobs/002

"/vmfs/volumes/datastore1/xsi-dir/xsibackup" \
--backup-prog=vmkfstools \
--certify-backup=yes \
--backup-point=/vmfs/volumes/backup_nas/$( date +%Y%m'00000000' ) \
--backup-type=running \
--backup-room=2200 \
--backup-how=Hot \
--remote-xsipath=/vmfs/volumes/datastore1/xsi-dir \
--use-smtp=2 \
--mail-to=e-mail@domain.com \
--backup-id=002 \
--description="XSITools backup of production VMs" \
--on-success="backupId->005" \
--on-error="backupId->005" \
--exec=yes >> "/vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log"

**/xsi-dir/jobs/002

"/vmfs/volumes/datastore1/xsi-dir/xsibackup" \
--backup-prog=vmkfstools \
--certify-backup=yes \
--backup-point=/vmfs/volumes/backup_fuer_externUSB \
--backup-type=running \
--backup-how=Hot \
--remote-xsipath=/vmfs/volumes/datastore1/xsi-dir \
--use-smtp=2 \
--mail-to=e-mail@domain.com \
--backup-id=003 \
--description="XSITools backup of production VMs" \
--on-success="backupId->005" \
--on-error="backupId->005" \
--exec=yes >> "/vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log"


Error:
Today i got an e-mail with boath jobs where running yesterday evening..

warning job id:003
--------------------------------------------------------------------------------------------
Mon Jul 15 19:00:06 UTC 2019
XSIBACKUP-FREE 11.0.1 AT HOST:
esxi.argonag.local    IP v4: 192.168.30.15/ 255.255.255.0
VMware ESXi 6.7.0 build-8169922

Done hot backup (id: 003) using vmkfstools (no compression)
Available room in device /vmfs/volumes/backup_fuer_externUSB before backup: 1415 Gb.
Sparse size on disk of the selected virtual machines: 1270 Gb.
Needed room in device /vmfs/volumes/backup_fuer_externUSB for backup: 1214 Gb.
(Id)VM Name    State    Size (Gb)    Stop    Copy    Start    Time (min)    Speed (mb/s)
(4) Server01    ON    850/ 850    NO (hot backup)    OK    -    270    53/ 53
(5) Exchangeserver    ON    364/ 420    NO (hot backup)    OK    -    128    48/ 55
Available space in device /vmfs/volumes/backup_fuer_externUSB after backup: 1419 Gb.
Complete backup elapsed time: 398 min
Chained backup --on-error: backupid->005
Chained backup --on-success: backupid->005
Backup of ESXi configuration is not available in XSIBACKUP-FREE
Get XSIBACKUP-PRO at http://33hops.com
USE DISCOUNT COUPON XSIDREWYI

• [ Mon Jul 15 19:01:50 UTC 2019 ] WARNING (CLCERTN0), details [Server01] warning: the backup cannot be certified as the resulting disk will include some snapshots

--------------------------------------------------------------------------------------------


warning job id:002
--------------------------------------------------------------------------------------------

Done hot backup (id: 002) using vmkfstools (no compression)
The backup room has been limited to 2200 Gb.
Available room in device /vmfs/volumes/backup_nas/20190700000000 before backup: 1415 Gb.
Sparse size on disk of the selected virtual machines: 1270 Gb.
Needed room in device /vmfs/volumes/backup_nas/20190700000000 for backup: 1214 Gb.
(Id)VM Name    State    Size (Gb)    Stop    Copy    Start    Time (min)    Speed (mb/s)
(4) Server01    ON    850/ 850    NO (hot backup)    OK    -    261    55/ 55
(5) Exchangeserver    ON    364/ 420    NO (hot backup)    OK    -    128    48/ 55
Available space in device /vmfs/volumes/backup_nas/20190700000000 after backup: 1467 Gb.
Complete backup elapsed time: 390 min
Chained backup --on-error: backupid->005
Chained backup --on-success: backupid->005
Backup of ESXi configuration is not available in XSIBACKUP-FREE
Get XSIBACKUP-PRO at http://33hops.com
USE DISCOUNT COUPON XSIDREWYI

• [ Mon Jul 15 19:01:50 UTC 2019 ] WARNING (CLCERTN0), details [Server01] warning: the backup cannot be certified as the resulting disk will include some snapshots


--------------------------------------------------------------------------------------------



On Sunday only the job 002 worked perfectly like i set in root-crontab...
any idea..?

thx a lot

Offline

#2 2019-07-16 09:16:41

admin
Administrator
Registered: 2017-04-21
Posts: 1,362

Re: cronjob

ESXI cron is not equivalent to a Linux crond, it's a more primitive/basic kind of service, it lacks even an init control script to prevent duplicate execution and other such problems. As VMWare modifies Busybox source code, you can't even be sure of what is current ESXi version supported syntax and you can't trust Busybox documentation either, should it exist.

VMWare does not seem to have published any post regarding the use of the crond service, so we can only guess and use a trial/error approach. The minute, hour and DoM seem to work as expected though.

I'm afraid it is not uderstanding the day range with the hyphen in between (1-6). Try to use commas to separate days. Some older busybox implementations took day abbreviations like: sun, mon, tue...

According to this openwrt.org document making reference to Busybox cron, sunday is 0 and using 7 will lead to commands being run every day.

https://openwrt.org/docs/guide-user/base-system/cron

-----------------------------------------------------------------

Tip:

If you find that single days of the week work as expected, split your command into multiple lines, dirty but effective.

Offline

#3 2019-07-16 12:03:10

mbosshard
Member
Registered: 2018-07-17
Posts: 15

Re: cronjob

ok thanks a lot for your infos.. i try now with this

0 19 * * 1-6 "/vmfs/volumes/datastore1/xsi-dir/jobs/003"
0 19 * * 0 "/vmfs/volumes/datastore1/xsi-dir/jobs/002"

if warning persist i will try with mon,sun etc
i will give feedback

Offline

#4 2019-07-16 15:33:01

admin
Administrator
Registered: 2017-04-21
Posts: 1,362

Re: cronjob

Remember that you can always split the schedule in multiple lines.

Offline

#5 2019-07-17 09:17:58

mbosshard
Member
Registered: 2018-07-17
Posts: 15

Re: cronjob

yesterday evening it worked perfectly.. i will inform ya if anything won't work!
thx a lot! smile

Last edited by mbosshard (2019-07-17 09:18:20)

Offline

#6 2019-07-17 09:22:55

mbosshard
Member
Registered: 2018-07-17
Posts: 15

Re: cronjob

i ihave an other customer that i run crontab like this
0 18 1-7 * 6 "/vmfs/volumes/Datastore_SAS_10k_RAID5/xsi-dir/jobs/005"
0 18 8-15 * 6 "/vmfs/volumes/Datastore_SAS_10k_RAID5/xsi-dir/jobs/001"
0 18 16-23 * 6 "/vmfs/volumes/Datastore_SAS_10k_RAID5/xsi-dir/jobs/005"
0 18 24-31 * 6 "/vmfs/volumes/Datastore_SAS_10k_RAID5/xsi-dir/jobs/001"
0 18 * * 5 "/vmfs/volumes/Datastore_SAS_10k_RAID5/xsi-dir/jobs/003"

works perfectly... just for info..

Offline

#7 2019-07-17 10:28:21

admin
Administrator
Registered: 2017-04-21
Posts: 1,362

Re: cronjob

O.K., so it was the sunday = 0 that was causing the issue apparently.
ESXi components are like Forrest's box of chocolate, you never know what you're going to get.

Offline

#8 2019-07-17 12:39:16

mbosshard
Member
Registered: 2018-07-17
Posts: 15

Re: cronjob

well 7 wouldn't work for sunday (maybe its for everyday/like you said)
If i won't post on next monday an issue, 0 will work for Sunday
thx a lot for help smile

Offline

Board footer