You are not logged in.
Pages: 1
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
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
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
ESXi Cron daemon can get picky, follow this cron troubleshooting guide
Offline
ESXi Cron daemon can get picky, follow [https://33hops.com/xsibackup-cron-troubleshooting.html](c)VMWare (c)ESXi cron troubleshooting guide[/url]
what could I still try? Generating date to file works but cron job 001 does not start
Offline
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
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
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
I have this problem exactly. I have not resolved it until now. I'm already thinking about downgrading vmware to esx 6 version and xsibackup to 9 version.
Offline
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
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
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:
cd /vmfs/volumes/5c0191f0-e8540066-c097-a0369f850e04/xsi-dir/jobs/
vi 001
Last edited by darkrin (2019-01-24 02:15:06)
Offline
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
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
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 of editor other than vi in the shell of vmware esxi itself.
Last edited by Hyrules (2019-01-24 22:13:10)
Offline
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
Please do you have someone update xsibackup free? i can try upgrade this version.
Offline
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
Well upgrading did not work.
Here is my version : 6.7.0 Update 1 (Build 11675023)
Anything else you guys need to help ?
Offline
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
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
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
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
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
Pages: 1