[GH-ISSUE #32] cv4pve in /etc/cron.d , won't auto start #29

Closed
opened 2026-02-26 17:44:02 +03:00 by kerem · 7 comments
Owner

Originally created by @changchichung on GitHub (Apr 17, 2020).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/32

OS: debian 9
PVE Version: pve-manager/5.4-10/9603c337
cv4pve version: 1.7.2

I changed backup method from eve4pve to cv4pve couple days ago.
using the same way , add a file in /etc/cron.d , with almost the same content , except the snapshot command.
but cv4pve wont take snapshot at the specified time in crontab.
I have no idea why .
I could run the command in prompt without problems , but it just won' start in crontab

here is /etc/cron.d/cv4pve-autosnap

2020-04-17 11:19:46 [root@hqs030 ~]$ cat /etc/cron.d/cv4pve-autosnap 
MAILTO="changch@abc.com"
#ansible
0 2 * * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_"
#build
0 3 1 * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 100 snap --keep 3 --label "_kw_build_"
2020-04-17 11:22:12 [root@hqs030 ~]$

in /var/log/cron.log , it shows the command already been executed.

Apr 16 23:00:01 hqs030 CRON[23813]: (root) CMD (tar czvf "/usr/local/backup/pve_\$(date '+%Y-%m-%d').tgz" /etc/pve)
Apr 17 02:00:01 hqs030 CRON[5722]: (root) CMD (cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_")

but pve didnt see the sanpshot.

2020-04-17 11:24:56 [root@hqs030 cron.d]$ qm listsnapshot 101
`-> init_ansiblecontrol         2019-07-15 10:15:17     no-description
    `-> before_upgrade_ansible_to_27 2019-07-19 11:29:56     no-description
`-> auto_kw_ansible_200415110438 2020-04-15 11:04:39     cv4pve-autosnap
    `-> current                                         You are here!
2020-04-17 11:25:37 [root@hqs030 cron.d]$ 

any suggestions ??

Originally created by @changchichung on GitHub (Apr 17, 2020). Original GitHub issue: https://github.com/Corsinvest/cv4pve-autosnap/issues/32 OS: debian 9 PVE Version: pve-manager/5.4-10/9603c337 cv4pve version: 1.7.2 I changed backup method from eve4pve to cv4pve couple days ago. using the same way , add a file in /etc/cron.d , with almost the same content , except the snapshot command. but cv4pve wont take snapshot at the specified time in crontab. I have no idea why . I could run the command in prompt without problems , but it just won' start in crontab here is /etc/cron.d/cv4pve-autosnap ``` 2020-04-17 11:19:46 [root@hqs030 ~]$ cat /etc/cron.d/cv4pve-autosnap MAILTO="changch@abc.com" #ansible 0 2 * * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_" #build 0 3 1 * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 100 snap --keep 3 --label "_kw_build_" 2020-04-17 11:22:12 [root@hqs030 ~]$ ``` in /var/log/cron.log , it shows the command already been executed. ``` Apr 16 23:00:01 hqs030 CRON[23813]: (root) CMD (tar czvf "/usr/local/backup/pve_\$(date '+%Y-%m-%d').tgz" /etc/pve) Apr 17 02:00:01 hqs030 CRON[5722]: (root) CMD (cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_") ``` but pve didnt see the sanpshot. ``` 2020-04-17 11:24:56 [root@hqs030 cron.d]$ qm listsnapshot 101 `-> init_ansiblecontrol 2019-07-15 10:15:17 no-description `-> before_upgrade_ansible_to_27 2019-07-19 11:29:56 no-description `-> auto_kw_ansible_200415110438 2020-04-15 11:04:39 cv4pve-autosnap `-> current You are here! 2020-04-17 11:25:37 [root@hqs030 cron.d]$ ``` any suggestions ??
kerem closed this issue 2026-02-26 17:44:02 +03:00
Author
Owner

@franklupo commented on GitHub (Apr 17, 2020):

Hi,
if you use the command line does it work?

<!-- gh-comment-id:615074349 --> @franklupo commented on GitHub (Apr 17, 2020): Hi, if you use the command line does it work?
Author
Owner

@changchichung commented on GitHub (Apr 17, 2020):

yes. it works.

2020-04-17 14:50:34 [root@hqs030 ~]$ cat /etc/cron.d/cv4pve-autosnap 
MAILTO="changch@abc.com"
#ansible
0 2 * * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_"
#build
0 3 1 * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 100 snap --keep 3 --label "_kw_build_"
2020-04-17 14:50:38 [root@hqs030 ~]$ cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_"
ACTION Snap 
VMs:   101  
Label: _kw_ansible_ 
Keep:  7 
State: False
----- VM 101 -----
VM 101 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: auto_kw_ansible_200417145051
2020-04-17 14:51:30 [root@hqs030 ~]$ 

<!-- gh-comment-id:615076766 --> @changchichung commented on GitHub (Apr 17, 2020): yes. it works. ``` 2020-04-17 14:50:34 [root@hqs030 ~]$ cat /etc/cron.d/cv4pve-autosnap MAILTO="changch@abc.com" #ansible 0 2 * * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_" #build 0 3 1 * * root cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 100 snap --keep 3 --label "_kw_build_" 2020-04-17 14:50:38 [root@hqs030 ~]$ cv4pve-autosnap --host 192.168.1.30 --username root --password rootpassword --vmid 101 snap --keep 7 --label "_kw_ansible_" ACTION Snap VMs: 101 Label: _kw_ansible_ Keep: 7 State: False ----- VM 101 ----- VM 101 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent Create snapshot: auto_kw_ansible_200417145051 2020-04-17 14:51:30 [root@hqs030 ~]$ ```
Author
Owner

@franklupo commented on GitHub (Apr 17, 2020):

The new version using Api web.
Which user do you use? Permission Problem?

<!-- gh-comment-id:615078185 --> @franklupo commented on GitHub (Apr 17, 2020): The new version using Api web. Which user do you use? Permission Problem?
Author
Owner

@changchichung commented on GitHub (Apr 17, 2020):

root , should not be permission problem.

<!-- gh-comment-id:615084178 --> @changchichung commented on GitHub (Apr 17, 2020): root , should not be permission problem.
Author
Owner

@franklupo commented on GitHub (Apr 17, 2020):

Paths?

<!-- gh-comment-id:615295686 --> @franklupo commented on GitHub (Apr 17, 2020): Paths?
Author
Owner

@changchichung commented on GitHub (Apr 20, 2020):

yes , it's related to the path , I put cv4pve-autosnap in /usr/local/bin , but debian 9 search in /usr/local/sbin by deault .

<!-- gh-comment-id:616344279 --> @changchichung commented on GitHub (Apr 20, 2020): yes , it's related to the path , I put cv4pve-autosnap in /usr/local/bin , but debian 9 search in /usr/local/sbin by deault .
Author
Owner

@franklupo commented on GitHub (Apr 20, 2020):

Hi, remember that this version can be run externally to Proxmox VE.

Best regards

<!-- gh-comment-id:616349805 --> @franklupo commented on GitHub (Apr 20, 2020): Hi, remember that this version can be run externally to Proxmox VE. Best regards
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-autosnap#29
No description provided.