vzdump hookscript error 'INFO: find: -exec: no terminating ";" or "+" and find: missing argument to -exec''

Emmanuel92

New Member
Jul 24, 2019
6
0
1
31
Good day all,

I might be doing something wrong that's very simple, I get the following error in the log file:

find: missing argument to -exec
or
INFO: find: -exec: no terminating ";" or "+"

These errors I get on proxmox 5.4 and newer, but on the proxmox 4.xx version the hookscript does what it should, removes older files from server and remote backup server. But on the later version it gives those errors. I'll put an example below.

# remove files older than 7 days
system ("/usr/bin/sshpass -p jeezy ssh root\@192.168.10.18 'find /mnt/RD2/backups/ripper/vzdump-qemu* -mtime +7 -exec rm {} \;' ");

system ("find /var/lib/vz/dump/vzdump-qemu* -mtime +7 -exec rm {} \; ");


If there's anything wrong, please advise a way to correct it, it works on version 4, not the version 5 and above, it only copies to the backup server but does not remove the older files.

Many thanks

Emmanuel
 

Alwin

Proxmox Staff Member
Staff member
Aug 1, 2017
3,438
295
88
# remove files older than 7 days
system ("/usr/bin/sshpass -p jeezy ssh root\@192.168.10.18 'find /mnt/RD2/backups/ripper/vzdump-qemu* -mtime +7 -exec rm {} \;' ");

system ("find /var/lib/vz/dump/vzdump-qemu* -mtime +7 -exec rm {} \; ");
It seems that the '\' needs to be escaped as well (\\).
 
  • Like
Reactions: Emmanuel92

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!