Backup Job APPOLO2018-08-22T125035.vbk
find "$path" -type f -mmin +9 | xargs rm
rm: cannot remove ‘/mnt/hdd-backup/APPOLO/Backup’: No such file or directory
rm: cannot remove ‘Job’: No such file or directory
rm: cannot remove ‘APPOLO/Backup’: No such file or directory
rm: cannot remove ‘Job’: No such file or directory
rm: cannot remove ‘APPOLO.vbm’: No such file or directory
oldfiles=$(find "$path" -type f -mmin +9)
for oldfile in $oldfiles
do
rm $oldfile 2>> $flog
done
rm: cannot remove ‘/mnt/hdd-backup/APPOLO/Backup’: No such file or directory
rm: cannot remove ‘Job’: No such file or directory
rm: cannot remove ‘APPOLO/Backup’: No such file or directory
rm: cannot remove ‘Job’: No such file or directory
rm: cannot remove ‘APPOLO.vbm’: No such file or directory
find "$path" -type f -mmin +9 -print0 | xargs -0 rm
find "$path" -type f -mmin +9 -delete
A=$(find "$path" -type f -mmin +9)
while read; do rm "$REPLY";done<<<"$A"
выполняю:
find "$path" -type f -mmin +9 | xargs rm
...
Ага. xargs не умеет в пути с пробелами.
find ... -print0 | xargs -0 ...
-- т.е. использовать нулевой символ в качестве разделителя полей при выводе из find и при вводе в xargs.