#1 2019-12-09 08:11:46

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

Cronjob won't run

Hello

i've a problem to get the cronjob run on an ESXi
after i installed over the command xsibackup --cron-install the jobs folder wasn't created
i manually did this...
after i use xsibackup --update-cron the job is inserted in /var/spool/cron/crontabs/root
on the time it should run i see in  /var/log/syslog.log the line i inserted in the root-crontab but it won't creat any backup... neighter the log write something...

on saturday i run the job manually with
xsibackup --backup-id=001 and it worked like it should...

here my config files

root-crontab (/vmfs/volumes/RAID5/xsi-dir/conf)
0 1 * * 0 "/vmfs/volumes/RAID5/xsi-dir/jobs/001" > /dev/null 2>&1

xsiopts (/vmfs/volumes/RAID5/xsi-dir/conf)
xsidefaultpath="/vmfs/volumes/RAID5/xsi-dir"

001 (/vmfs/volumes/RAID5/xsi-dir/jobs)
# This is a backup job file example. It starts with the path to your
# xsibackup file and ends with the redirection to the log file. Please
# do make sure that you keep first and last lines, changing paths to
# match your working environment.

"/vmfs/volumes/RAID5/xsi-dir/xsibackup" \
--backup-prog=vmkfstools \
--certify-backup=yes \
--backup-point=/vmfs/volumes/backup_nas \
--date-dir=yes \
--backup-type=custom \
--backup-vms=EUPSBS001.eup.local!EUPSBS001.eup.local_2.vmdk \
--backup-room=3200 \
--backup-how=Hot \
--remote-xsipath=/vmfs/volumes/RAID5/xsi-dir \
--use-smtp=2 \
--mail-to=hans@ueli.com \
--backup-id=001 \
--description="XSITools backup of production VMs" \
--override=xsibakfilter \
--on-success="backupId->005" \
--on-error="backupId->005" \
--exec=yes >> "/vmfs/volumes/RAID5/xsi-dir/var/logs/xsibackup.log"

any idea about what i can check?

thx a lot!!

Offline

#2 2019-12-09 15:42:15

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

Re: Cronjob won't run

Have you checked that you have permissions on the xsibackup and the log files. You are running it out of the recommended installation path, thus you must make sure that everything has rights to read and write as required.

Offline

#3 2019-12-10 08:41:03

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

Re: Cronjob won't run

yea the directorys xsi-dir, var and logs have 0755 and the xsibackup.log is 0644 i think thats ok
what i see when i compare to other xsi... the conf directory and the files inside are only 0700 i changed the permission like an other working xsi backup.. i will send feedback tomorrow... thx a lot

Offline

#4 2019-12-11 07:35:41

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

Re: Cronjob won't run

Pefekt this it was.. strange why it didn't set the right permission at installation... i change my job tomorrow... i would like to donate you guys for the fabulous backupsoftware and support somthing... on wich bank can i transfer a donation?

best regards
Marco

Offline

#5 2019-12-12 11:58:27

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

Re: Cronjob won't run

Thank you Marco, if you want to make a donation just buy some commercial version and enjoy the extended options.

Offline

#6 2019-12-12 15:11:22

jcp2mill
Member
Registered: 2019-12-12
Posts: 8

Re: Cronjob won't run

Hi Sorry to hijack this thread but I'm also having problems with the new cron method I've created a job and can run it successfully using ./xsibackup --run-backup=001

but it never runs from cron I've run update-cron rebooted the host etc but still not running any ideas.

I've checked if cron is running by doing:

ps -c | grep -v grep | grep 'busybox crond'

I can see my line in crontab so I'm not sure where the issue is.

I'm unable to add a line to the crontab to test directly as vi says the file is read only even when cron is stopped

I've set permissions on xsi-dir to 755

Any recommendations as to where to go next?

my job looks like this:


"/volumes/datastore1/xsi-dir/xsibackup" \
--backup-point=/vmfs/volumes/BACKUP-STORE \
--backup-type=all \
--date-dir=yes \
--backup-room=1000 \
-–mail-from=backuphost01@internalmail.co.uk \
--mail-to=sysadmin@internalmail.co.uk \
--backup-id=001 \
--description"BACKUP-HOST01 Vm backup" \
--smtp-srv=mailserver.com \
--smtp-port=465 \
--smtp-usr=emailaddr@gmail.com \
--smtp-pwd=password \
--smtp-auth=yes \
--smtp-sec=TLS \
--exec=yes >> "/vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log" 2>&1

Last edited by jcp2mill (2019-12-12 15:13:21)

Offline

#7 2019-12-12 17:10:18

jcp2mill
Member
Registered: 2019-12-12
Posts: 8

Re: Cronjob won't run

I've sucessfully added extra line to crontab and it is running ok, so does that mean it's the syntax of my job even though it runs ok locally?

Offline

#8 2019-12-12 19:26:37

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

Re: Cronjob won't run

Some thing mixed here. Don't worry to hijack anything, this is an open forum, so anybody can pose their questions.

The /var/spool/cron/crontabs/root file has 0600 permissions so just change them to 0700 edit it and change them back again to 0600 if you will. (c)XSIBackup does that for you when you use the --update-cron method.

By what you say I deduce that you had some wrong syntax in the cron schedule itself, ESXi is a bit picky in many ways, and it's also primitive, as it's just a binary without any init script, so it's easy to duplicate instances when you become nervous and hang it. Once you know about its "charm" and learn how to deal with it works well though.

Your job syntax seems to be O.K.

Offline

#9 2019-12-17 11:49:25

jcp2mill
Member
Registered: 2019-12-12
Posts: 8

Re: Cronjob won't run

Hi, Sorry for the delayed update been on other things for a while. I got my other cron task (echo) running so I know cron is running OK.

should I be able to run my xsibackup job manually so if i enter "/vmfs/volumes/datastore1/jobs/001"
in a root command prompt should it run?

(because it doesn't on my install) i tried chmod =x on the 001 file itself but didn't seem to make any difference

Offline

#10 2019-12-17 11:51:40

jcp2mill
Member
Registered: 2019-12-12
Posts: 8

Re: Cronjob won't run

I should mention that I used the installer to install my xsibackup and although everything installed and tested oK a job directory was not automatically created so I created one myself using mkdir. IS it possible it's the permissions of this folder that are cuasing the issue?

Offline

#11 2019-12-17 17:23:34

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

Re: Cronjob won't run

We detected some small issues in latest ESXi 6.7.0 builds, we worked some of them around in the GUI so far. The jobs folder should be automatically created during the installation process, we will re-check that. Thank you for the feedback.

Offline

#12 2019-12-18 08:35:38

jcp2mill
Member
Registered: 2019-12-12
Posts: 8

Re: Cronjob won't run

Hi,

No problem it wasn't an issue as such just wondered if it might be what was causing my problem.

Any ideas?

My root-crontab looks like this:

25   12    *   *   *  "/vmfs/volumes/datastore1/xsi-dir/jobs/001" > /dev/null 2>   

I can't execute 001 locally from bash but not sure if I should be able to or not?

Offline

#13 2019-12-18 08:49:47

jcp2mill
Member
Registered: 2019-12-12
Posts: 8

Re: Cronjob won't run

Sorry I just did the obvious thing and checked the log it's my first lien in my job file it reads:

"/volumes/datastore1/xsi-dir/xsibackup"

should be:

"/vmfs/volumes/datastore1/xsi-dir/xsibackup"

I looked at it a thousand times but only just noticed that when I saw the path wasn't found in the log. sad

Thanks you for your help and apologies for missing the obvious I think the thing that was throwing me was that I could execute the job by using xsibackup --run-backup=001

In nay case thanks for a great piece of software and have a great xmas!

Offline

#14 2019-12-18 11:00:41

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

Re: Cronjob won't run

No worries, Merry Christmas!

Offline

Board footer