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

Emmanuel92

New Member
Jul 24, 2019
6
0
1
36
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
 
# 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