March 19th, 2011, 04:54 PM
Deleting multiple files in remote box via sh
Several files in remote machines ought to be deleted via sh. Name of the files to be deleted are know
1) script was written with ftp (requires credential) and delete command. File names were passed as array(iterated via for loop-with ftp+delete commands enclosed within for loop). files were not getting deleted by this approach
2) another approach attempted was to pass temp.ftp(which contains delete command) to ftp command and rm the temp.ftp file eg.ftp <<temp.ftp..but this would be sucessful for open ftp which doenst require credentials
require pointers to delete muliple files in remote machine via shell script
March 21st, 2011, 10:30 AM
1) Setup ssh connectivity (exchange ssh keys).
2) Use ssh to remove the files:
cat fileList.tmp|ssh -C $TGTHOST \"rm -f - \" "