in reply to Rename all files on remote server to *.bak recursively
Just put an appropriate Shell script on the remote system and then tell the remote, via SSH, to execute that script. It will find the files locally to itself and then rename them appropriately. Provide the directory-path as an argument to that remote shell script. The shell script in question can easily consist of a find -r command, piped to a sed command to remove the file-extension, piped to an xargs rm command with placeholders. The initiating system does not need to be (and should not be) concerned with the exact list of files that may be present on the remote ... the remote knows best. All that the initiating system needs to do is to ask the remote to do, within its (the remote’s ...) own local context, what it is an ideal position to do. The local Captain does not need to know anything about the remote’s directory-status in order to give that remote Private an Order (“Sir! Yes Sir!!”™) to be carried out competently at the remote location.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Rename all files on remote server to *.bak recursively
by nancylt723 (Initiate) on Jun 05, 2014 at 21:16 UTC | |
by salva (Canon) on Jun 06, 2014 at 14:32 UTC | |
by soonix (Chancellor) on Jun 06, 2014 at 09:55 UTC |