I need to remove all the files from specific folder that is copied to remote machine using following command:
tar -c test_sandy | ssh sky@my_home_vm 'tar -xf - -C /scratch/backup'
I see all the files from test_sandy has been copied to remote machine, now I wanted to remove these files after say one minute:
ssh my_home_vm find $backup_path/test_sandy/* -type d -mmin +1 -exec rm -rf {} \;
But I don't see those file getting deleted, but if, I run the delete it directly from remote machine (instead doing "ssh my_home_vm") it worked.
$backup_path
is being evaluated on the local system, not on the remote server. Does usingfind /scratch/backup/test_sandy/
(no * is necessary) change the process?