Question Details

Browse

How do I delete a file on a remote server using a script ?

By Sunny Gabriel - May. 12, 2008

So I have a shell script that copies some files over from machine A to machine B using scp. I now want to delete a file on the remote server using the same script. Do-able? How? Mu-chos gracias!


Answers

Add Answer
  1. By OSAf W on May. 13, 2008

    Hi gsunny,


    I did not really understand the query. The same script will not work for another operation without changes. You have not provided a snippet of the script that you run to further analyse the problem.


    1. scp does not have delete option. It can only do a copy. http://linux.about.com/od/commands/l/blcmdl1_scp.htm


    2. You mentioned that you had a script which in-turn uses scp. The script will have to be modified if you would like to delete the file that you copy. scp will not do it but some other command will.


    I tried with the limited information you provided. Let me know if this suffices.


    0 Votes
Share your knowledge

Related Questions

Browse Get answers and share your expertise.