#1 2020-05-26 23:32:21

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

not running cron jobs

hi all,

so i have made a cronjob for xsi backup free but it doesnt work

i have tried it manually and it works fine

vi /vmfs/volumes/datastore11/xsi-dir/conf/root-crontab

/vmfs/volumes/datastore11/xsi-dir/xsibackup --time="Mon 02:00|Wed 02:00|Fri 02:00|Sun 02:00" --backup-point=/vmfs/volumes/datastore2/backup/esx02 --backup-type=running --date-dir=yes --backup-room=1000

obviously running it manually i cut out the time options

does anyone know why its not working, can i edit the actual crontab in the actual host, thats another option?

thanks,
rob

Offline

#2 2020-05-26 23:51:16

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

what an idiot

solved it

/vmfs/volumes/datastore1/xsi-dir/xsibackup --update-cron

Offline

#3 2020-05-27 00:04:22

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

Re: not running cron jobs

Great!. The best fail at the simplest tasks ;-) we know that by experience.

Offline

#4 2020-06-02 22:47:25

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

mmm... doesnt seem to work, i have left it a few days and i cant see a new date folder in my "/vmfs/volumes/datastore2/backup/esx02"

but its added it to the  "/var/spool/cron/crontabs/root"

/vmfs/volumes/datastore11/xsi-dir/xsibackup --time="Mon 02:00|Wed 02:00|Fri 02:00|Sun 02:00" --backup-point=/vmfs/volumes/datastore2/backup/esx02 --backup-type=running --date-dir=yes --backup-room=1000 # Added by XSIBackup

if i run it manually tho without the time option it works fine

rob

Offline

#5 2020-06-02 23:08:33

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

do i need to restart the host, is that why is hasnt picked up the new cron job?

EDIT - think i found the solution

/bin/kill $(cat /var/run/crond.pid)

/var/spool/cron/crontabs/root/bin/busybox crond

or is it this

/usr/lib/vmware/busybox/bin/busybox crond

Last edited by Robertkwild (2020-06-02 23:33:34)

Offline

#6 2020-06-03 09:08:08

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

Re: not running cron jobs

This way of invoking the cron has been deprecated years ago:

--time="Mon 02:00|Wed 02:00|Fri 02:00|Sun 02:00"

To use the cron:

- Install it: ./xsibackup --install-cron
- Add your schedules to the root crontab at: <installation-dir>/conf/root-crontab
- Update the ESXi crontab: ./xsibackup --update-cron

Offline

#7 2020-06-03 09:45:24

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

so is this the correct  one to use on the cron?

00 02 * * 0-6/2 /vmfs/volumes/datastore11/xsi-dir/xsibackup --backup-point=/vmfs/volumes/datastore2/backup/esx02 --backup-type=running --date-dir=yes --backup-room=1000

basically every other day at 2am

ps - i would change your youtube video in how to make a cron then as this says use the time options

https://www.youtube.com/watch?v=hv2JPdVjglA

Last edited by Robertkwild (2020-06-03 09:46:56)

Offline

#8 2020-06-03 10:10:00

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

Re: not running cron jobs

That is an old video.
No, you are not doing it right it is much simpler than that.
https://33hops.com/xsibackup-composing- … -jobs.html

The above link comes out first when looking for "XSIBackup configure job" in Google
Run the job on screen to make sure it works, then just append --save-job=001 (https://33hops.com/xsibackup-help-man-page.html#savejob)

The job will be saved as <install-dir>/etc/jobs/001

Then add the schedule to the <installation-dir>/conf/root-crontab file

0 2 * * * /vmfs/volumes/datastore11/xsi-dir/jobs/001

Once you have saved the above run: ./xsibackup --update-cron=root

You are doubling figures in your cron schedule, that is not neccesary and may lead to errors. On the other side the syntax you are using for the weekday is probably too complicated for ESXi (0-6/2)

Use some simpler cron syntax, ESXi cron service IS NOT a full featured Linux cron service, it is a cut down version running from Busybox.

0-6 is equivalent to an asterisk (*) for the weekday thus you don't need anything in the weekday column.

Offline

#9 2020-06-03 10:26:10

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

ahhhh so esxi uses busybox a cut down version of cron, good to know

ive left out the option --save-job as im just running one cron for my backups but its good to know in future or do i need this option to add a cronjob?

atm its like this

00 02 * * * /vmfs/volumes/datastore1/xsi-dir/xsibackup --backup-point=/vmfs/volumes/datastore2/backup/esx01 --backup-type=running --date-dir=yes --backup-room=1000 # Added by XSIBackup

Offline

#10 2020-06-03 12:03:50

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

Re: not running cron jobs

NO you can't do that. Jobs must be packetized into job files by employing the --save-job argument. Then call the job file from the cron.

As per what we have read so far, you were a bit lost (probably our fault) in regards to which commands to use, thus we don't think you can afford to ignore --save-job, as it will ensure you are saving a correctly formated job file. Once you have done so, you may modify it manually.

Offline

#11 2020-06-03 12:08:18

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

i understand you Administrator, thanks, will let you know if it works smile

Offline

#12 2020-06-03 12:26:51

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

success!

0 2 * * * /vmfs/volumes/datastore11/xsi-dir/jobs/001 # Added by XSIBackup
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Current number of crond instances is 1, service seems to be running O.K.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Killed
[root@lon-p-esx02:/vmfs/volumes/5ded0efa-410c4d6a-3b7e-ac1f6bdc45fe/xsi-dir] cd /
[root@lon-p-esx02:~] cat /vmfs/volumes/datastore11/xsi-dir/jobs/001
"/vmfs/volumes/datastore11/xsi-dir/xsibackup" \
--backup-point="/vmfs/volumes/datastore2/backup/esx02" \
--backup-type="running" \
--date-dir="yes" \
--backup-room="1000" \
--backup-id="001" \
--exec=yes >> "/vmfs/volumes/datastore11/xsi-dir/var/logs/xsibackup.log"
[root@lon-p-esx02:~]

lets see if it runs

Offline

#13 2020-06-07 23:02:44

Robertkwild
Member
Registered: 2020-05-25
Posts: 20

Re: not running cron jobs

it worked!!!!!!!!!!!

Offline

Board footer