Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv4pve in /etc/cron.d , won't auto start #32

Closed
changchichung opened this issue Apr 17, 2020 · 7 comments
Closed

cv4pve in /etc/cron.d , won't auto start #32

changchichung opened this issue Apr 17, 2020 · 7 comments

Comments

@changchichung
Copy link

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 ??

@franklupo
Copy link
Member

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

@changchichung
Copy link
Author

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 ~]$ 

@franklupo
Copy link
Member

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

@changchichung
Copy link
Author

root , should not be permission problem.

@franklupo
Copy link
Member

Paths?

@changchichung
Copy link
Author

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 .

@franklupo
Copy link
Member

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

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants