I am using xargs to remove files from remote server.
xargs -a /var/log/del.log -i -exec ssh root@abc.com 'rm -rf "{}"'
del.log
contains path of the files which are deleted on local server and I want to delete them on remote server. Every thing is working fine but problem starts when their is a temoprary office file like ~$excel.xlsx
when file naming like this occur xargs makes the command like.
ssh root@abc.com 'rm -rf "~.xlxs"' - which is wrong,
It should be like - ssh root@abc.com 'rm -rf "~$excel.xlxs"'
Why xargs is doing like this? May be xargs is excepting it as variable. I need some solutions please.
Or is there a better way to delete files from remote server? Provided the local server has the list of path which need to be deleted on remote.