#1 2019-01-17 13:47:58

paulee
Member
Registered: 2018-12-10
Posts: 13

Cron problem

My cron does not work on xsibackup jobs 001

I try this solutions.
for p in $(ps -c | grep -v grep | grep 'busybox crond' | awk '{print $1}'); \
do kill -9 $p;done; \
/usr/lib/vmware/busybox/bin/busybox crond; \
ps -c | grep -v grep | grep 'busybox crond'

i see only this

[root@localhost:/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir] for p in $(ps -c | grep -v grep | grep 'busybox crond' | awk '{print $1}'); \
> do kill -9 $p;done; \
> /usr/lib/vmware/busybox/bin/busybox crond; \
> ps -c | grep -v grep | grep 'busybox crond'
2122361  2122361  busybox                         /usr/lib/vmware/busybox/bin/busybox crond
[root@localhost:/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir]

And cron dont work sad

So, make sure that you have the entries that you want there. You can check the cron is working by just adding a line like this to your crontab at: /var/spool/cron/crontabs/root

*/1 * * * * echo "$(date)" >> /tmp/my-cron-test.txt
You should then see a line being recorded there every minute, you can use this command in a different window:

tail -f /tmp/my-cron-test.txt

i see this

[root@localhost:~] tail -f /tmp/my-cron-test.txt
Thu Jan 17 13:47:01 UTC 2019
Thu Jan 17 13:48:01 UTC 2019
Thu Jan 17 13:49:01 UTC 2019
Thu Jan 17 13:50:01 UTC 2019

/var/spool/cron/crontabs/root
#min hour day mon dow command
1    1    *   *   *   /sbin/tmpwatch.py
1    *    *   *   *   /sbin/auto-backup.sh
0    *    *   *   *   /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5  *    *   *   *   /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
00   1    *   *   *   localcli storage core device purge

50 13 * * * "/vmfs/volumes/datastore1/xsi-dir/jobs/001"
*/1 * * * * echo "$(date)" >> /tmp/my-cron-test.txt


Cron on vmware have someone log file?

Last edited by paulee (2019-01-17 14:04:50)

Offline

#2 2019-01-19 14:47:41

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

I'm having the same issue with the latest XSI backup free and VMWare ESXI 6.7. Can't get the backup to run with the cron.

Last edited by Hyrules (2019-01-19 16:49:21)

Offline

#3 2019-01-20 17:28:37

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

Re: Cron problem

ESXi Cron daemon can get picky, follow this troubleshooting guide

Offline

#4 2019-01-21 14:15:13

paulee
Member
Registered: 2018-12-10
Posts: 13

Re: Cron problem

admin wrote:

ESXi Cron daemon can get picky, follow this troubleshooting guide

what could I still try? Generating date to file works but cron job 001 does not start sad

Offline

#5 2019-01-21 14:48:02

paulee
Member
Registered: 2018-12-10
Posts: 13

Re: Cron problem

Hyrules wrote:

I'm having the same issue with the latest XSI backup free and VMWare ESXI 6.7. Can't get the backup to run with the cron.

Have you tried something like this could be done?

Offline

#6 2019-01-21 22:17:07

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

I have tried the troubleshooting guide. In my case it seems that the root executable cron file does not get executed event if I crond is working and has a pid.

Edit : strike that after editing the root file I had to restart the crond. Now it generates the minutes txt file.

Edit 2: The cron still doesn't want to execute my 001 job as well. I have tested it and it works outside of the cron. The jobs goes all the way to the end.

Last edited by Hyrules (2019-01-21 23:02:48)

Offline

#7 2019-01-23 08:21:24

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

Re: Cron problem

If you are getting the minutes file, then, there's something wrong in your job cron syntax. Maybe something that you are not taking into account. Check what your current time is, check permissions on the crontab, etc...

Offline

#8 2019-01-23 09:07:38

paulee
Member
Registered: 2018-12-10
Posts: 13

Re: Cron problem

I have this problem exactly. I have not resolved him until now. I'm already thinking about downgrading vmware to esx 6 version and xsibackup to 9 version. On versrion esx 6.7 and xsibackup 11.0.1 it does not work. This is already being solved here.
https://33hops.com/forum/viewtopic.php?id=399

Offline

#9 2019-01-23 18:05:38

roberto
Moderator
Registered: 2017-04-22
Posts: 49

Re: Cron problem

Many people, including ourselves, are using this cron. It is indeed working for you, as the test file demonstrates. It should not be that difficult to debug where your problem is:

1 - Backup your current crontab
2 - Call your crontab manually: # /var/spool/cron/crontabs/root
3 - Tail -f your xsibackup.log file in a different SSH window to see if something is being written there:
tail -f /vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log
4 - Reset permissions on your crontab:
chmod 0600 /var/spool/cron/crontabs/root
5 - Set some new execution time in the crontab.
6 - Check your tail -f window.
7 - If it still doesn't work open a new SSH window and tail -f your ESXi server's logs:
tail -f /scratch/log/syslog.log
...

And don't forget to check if there are ongoing XSIBackup processes by using ps -c, so that you don't pile processes up and clog execution.
ps -c | grep xsi

Last edited by roberto (2019-01-23 18:08:14)

Offline

#10 2019-01-23 22:08:33

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

xsibackup.log is generated but always empty.
There is no xsi process piling up.
wouldn't setting the root file to 0600 with chmod remove it's execute flag ?

all I see in the syslog is this line about xsi :
2019-01-22T02:00:01Z crond[2818719]: crond: USER root pid 2829706 cmd /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001

if I do # /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001 nothing happens.
if I do ./vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001 i get a not found error.

really odd. If I go directly in the folder do ./001 the job runs.

[root@Vmware:/vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs] ls -lha
total 256
drwx------    1 root     root       72.0K Dec  1 20:06 .
drwxr-xr-x    1 root     root       76.0K Jan 23 18:10 ..
-rwx------    1 root     root         329 Jan 23 18:08 001
[root@Vmware:/vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs]

Last edited by Hyrules (2019-01-23 22:23:21)

Offline

#11 2019-01-24 02:13:31

darkrin
Member
From: Maldives
Registered: 2019-01-18
Posts: 25

Re: Cron problem

Hyrules,

Please keep do remember, u cant do ./001 to a file, Hence you could access like that if its folder. To see more details of the root, u should use ls or ls -alh command.

only way to edit 001 File is using following command:

/vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/

vi 001

Last edited by darkrin (2019-01-24 02:15:06)

Offline

#12 2019-01-24 07:32:45

paulee
Member
Registered: 2018-12-10
Posts: 13

Re: Cron problem

roberto wrote:

Many people, including ourselves, are using this cron. It is indeed working for you, as the test file demonstrates. It should not be that difficult to debug where your problem is:

1 - Backup your current crontab
2 - Call your crontab manually: # /var/spool/cron/crontabs/root
3 - Tail -f your xsibackup.log file in a different SSH window to see if something is being written there:
tail -f /vmfs/volumes/datastore1/xsi-dir/var/logs/xsibackup.log
4 - Reset permissions on your crontab:
chmod 0600 /var/spool/cron/crontabs/root
5 - Set some new execution time in the crontab.
6 - Check your tail -f window.
7 - If it still doesn't work open a new SSH window and tail -f your ESXi server's logs:
tail -f /scratch/log/syslog.log
...

And don't forget to check if there are ongoing XSIBackup processes by using ps -c, so that you don't pile processes up and clog execution.
ps -c | grep xsi

Hello i try and i see this.
[root@localhost:~] /var/spool/cron/crontabs/root
/var/spool/cron/crontabs/root: line 2: 1: not found
/var/spool/cron/crontabs/root: line 3: 1: not found
/var/spool/cron/crontabs/root: line 4: 0: not found
/var/spool/cron/crontabs/root: line 5: */5: not found
/var/spool/cron/crontabs/root: line 6: 00: not found
/var/spool/cron/crontabs/root: line 7: 07: not found

i try change
#min hour day mon dow command
1    1    *   *   *   /sbin/tmpwatch.py
1    *    *   *   *   /sbin/auto-backup.sh
0    *    *   *   *   /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5  *    *   *   *   /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
00   1    *   *   *   localcli storage core device purge
07 14 * * * "/vmfs/volumes/datastore1/xsi-dir/jobs/001"

or

#min hour day mon dow command
1    1    *   *   *   /sbin/tmpwatch.py
1    *    *   *   *   /sbin/auto-backup.sh
0    *    *   *   *   /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5  *    *   *   *   /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
00   1    *   *   *   localcli storage core device purge
07 14 * * * "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/jobs/001"

nothing work. Where is problem permisions is 0777

[root@localhost:~] tail -f /scratch/log/syslog.log
2019-01-24T07:46:54Z sftp-server[2184711]: open "/var/spool/cron/crontabs/root" flags WRITE,CREATE,TRUNCATE mode 0666
2019-01-24T07:46:54Z sftp-server[2184711]: close "/var/spool/cron/crontabs/root" bytes read 0 written 405
2019-01-24T07:46:54Z sftp-server[2184711]: set "/var/spool/cron/crontabs/root" modtime 20190124-07:46:54
2019-01-24T07:46:54Z sftp-server[2184711]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"
2019-01-24T07:46:54Z sftp-server[2184711]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"
2019-01-24T07:48:20Z sftp-server[2184711]: open "/var/spool/cron/crontabs/root" flags WRITE,CREATE,TRUNCATE mode 0666
2019-01-24T07:48:20Z sftp-server[2184711]: close "/var/spool/cron/crontabs/root" bytes read 0 written 405
2019-01-24T07:48:20Z sftp-server[2184711]: set "/var/spool/cron/crontabs/root" modtime 20190124-07:48:20
2019-01-24T07:48:20Z sftp-server[2184711]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"
2019-01-24T07:48:20Z sftp-server[2184711]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"

[root@localhost:~] ps -c | grep xsi
2185011  2185011  grep                            grep xsi


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

2019-01-24T08:05:01Z crond[2122361]: crond: USER root pid 2185012 cmd /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
2019-01-24T08:05:01Z syslog[2185015]: starting hostd probing.
2019-01-24T08:05:18Z sftp-server[2184711]: open "/var/spool/cron/crontabs/root" flags WRITE,CREATE,TRUNCATE mode 0666
2019-01-24T08:05:18Z sftp-server[2184711]: close "/var/spool/cron/crontabs/root" bytes read 0 written 380
2019-01-24T08:05:18Z sftp-server[2184711]: set "/var/spool/cron/crontabs/root" modtime 20190124-08:05:18
2019-01-24T08:05:18Z sftp-server[2184711]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"
2019-01-24T08:05:18Z sftp-server[2184711]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"
2019-01-24T08:09:32Z sftp-server[2184711]: open "/var/spool/cron/crontabs/root" flags WRITE,CREATE,TRUNCATE mode 0666
2019-01-24T08:09:32Z sftp-server[2184711]: close "/var/spool/cron/crontabs/root" bytes read 0 written 380
2019-01-24T08:09:32Z sftp-server[2184711]: set "/var/spool/cron/crontabs/root" modtime 20190124-08:09:32
2019-01-24T08:09:32Z sftp-server[2184711]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"
2019-01-24T08:09:32Z sftp-server[2184711]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir"
2019-01-24T08:10:01Z crond[2122361]: crond: USER root pid 2185049 cmd /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
2019-01-24T08:10:01Z syslog[2185052]: starting hostd probing.
2019-01-24T08:11:48Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52                                                                                              ce0e70/xsi-dir/var"
2019-01-24T08:11:48Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae5                                                                                              2ce0e70/xsi-dir/var"
2019-01-24T08:11:49Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52                                                                                              ce0e70/xsi-dir/var/logs"
2019-01-24T08:11:49Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae5                                                                                              2ce0e70/xsi-dir/var/logs"
2019-01-24T08:11:59Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52                                                                                              ce0e70/xsi-dir/var/logs"
2019-01-24T08:11:59Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae5                                                                                              2ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:00Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52                                                                                              ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:00Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae5                                                                                              2ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:16Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:16Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:16Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:16Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:17Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:17Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:17Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:17Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:18Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:18Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:19Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:19Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:28Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:28Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:28Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:28Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:29Z sftp-server[2184666]: opendir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"
2019-01-24T08:12:29Z sftp-server[2184666]: closedir "/vmfs/volumes/5c0a2ccd-1cc20aa1-0de9-d4ae52ce0e70/xsi-dir/var/logs"

Last edited by paulee (2019-01-24 08:13:07)

Offline

#13 2019-01-24 16:30:20

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

Re: Cron problem

You are most probably editing your cron file outside ESXi and you have messed it up.

If you want to work in a mixed environment: Linux, Unix, Windows, you need to learn how line endings differ from one system to the other.
Linux and Unix file OSs (*NIX) use a line feed character <LF> or \n to end lines in a text file whereas Windows usually employs a double character <CR>+<LF> (\r\n) to end lines.

If you edit a *NIX configuration file in a Windows text editor and then you try to use it in the *NIX OS, it will most probably not work.

Offline

#14 2019-01-24 21:56:06

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

I have the same error has paulee. I can replicate it as well. I have a virgin root file in my folder. If I restore it instead of the modified cron I can execute it. If I edit it with vi after saving I cannot run it anymore. Goes the same if I use xsibackup --install-cron. I can assure you i'm not using any kind editor other than vi in the shell of vmware esxi itself.

Last edited by Hyrules (2019-01-24 22:13:10)

Offline

#15 2019-01-25 11:33:10

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

Re: Cron problem

That is really weird. We use different ESXi versions and builds every day and never saw this.
Please, let us know the details of your environment, there could be some bug in your vi binary.

Offline

#16 2019-01-25 11:49:57

paulee
Member
Registered: 2018-12-10
Posts: 13

Re: Cron problem

Please do you have someone update xsibackup free? i can try upgrade this version.

Offline

#17 2019-01-25 23:41:07

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

I just have updated my vmware environment to the latest version. I'll try to see if I can reproduce this in the lastest version.

Last edited by Hyrules (2019-01-26 16:10:05)

Offline

#18 2019-01-29 22:58:52

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

Well upgrading did not work.

Here is my version : 6.7.0 Update 1 (Build 11675023)

Anything else you guys need to help ?

Offline

#19 2019-01-30 12:48:54

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

Re: Cron problem

Please, keep in mind that the root crontab permission set is 0600. You need to change it to be able to edit the file with vi.

Depending on the crond implementation, and that can change from one ESXi version to the next, the cron daemon might not execute your crontab if permissions are not 0600.

As you previously had to change them to edit the file, we are asuming you are setting them back to 0600

Offline

#20 2019-01-30 19:30:51

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

This is interesting. I will check this tonight. I know that after running the cron installer it goes at 0700 if I check the flag. I'll try putting it back to 0600 and even it's default value.

Offline

#21 2019-01-31 11:35:58

Hyrules
Member
Registered: 2019-01-19
Posts: 10

Re: Cron problem

Well still not working. I have put back the cron root file to 0600. I see in the syslog file that the cron tries to execute the file :

2019-01-27T02:00:01Z crond[2107001]: crond: USER root pid 2111886 cmd /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001
2019-01-28T02:00:01Z crond[2107001]: crond: USER root pid 2141814 cmd /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001
2019-01-29T02:00:01Z crond[2107001]: crond: USER root pid 2149877 cmd /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001
2019-01-30T02:00:01Z crond[2107001]: crond: USER root pid 2158002 cmd /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001
2019-01-31T02:00:01Z crond[2107001]: crond: USER root pid 2166096 cmd /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/001

But the xsibackup file in the xsi-dir/var/logs is empty.

Offline

#22 2019-01-31 19:45:09

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

Re: Cron problem

How come this be?: 2019-01-31T02:00:01Z
That is a time in the future, you are supposed to be in the US east coast.

Offline

#23 2019-01-31 19:47:25

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

Re: Cron problem

Your cron is working, your job files are being called by the cron. You are just one step away. You are missing something, but we can't find it for you.

Offline

Board footer