scp then remove


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting scp then remove
# 1  
Old 11-29-2012
scp then remove

I have some files that want to be copy to remote server , and then verify if all files are successfuly copy , if yes, then remove it , can advise how to write a script ?

thanks .

---------- Post updated 11-29-12 at 06:11 AM ---------- Previous update was 11-28-12 at 11:16 PM ----------

As I have checked , the scp do not have remove function , can advise what can I do ? thanks
# 2  
Old 11-29-2012
Follow up with a rm via ssh or consider using rsync --delete ..., for example.
# 3  
Old 11-29-2012
I tried to use the command , the file can copy to remote side but do not remove it in sending side , can advise what can I do ? Thanks.

Code:
rsync -P  ssh -r  --delete-after test.txt user@remote:/tmp


Last edited by Scott; 11-29-2012 at 09:50 PM.. Reason: Code tags again
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies

2. UNIX for Dummies Questions & Answers

How to use scp?

How to copy multiple directories using single command on solaris 10 from server A to server B. I tried scp but its working only one directory at atime How to acheive this with simple and short solution????? (6 Replies)
Discussion started by: buzzme
6 Replies

3. Shell Programming and Scripting

remove brackets and put it in a column and remove repeated entry

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (2 Replies)
Discussion started by: manigrover
2 Replies

4. Shell Programming and Scripting

SCP

Hi All, Please help on the below command scp -r 'directory name'inrvgo@IP:/export/home/muthu/prod_12-09-2010 I am trying to copy a directory from one server to another server using the above command but its displaing the error (missing destination file) but the diectory was there in the... (1 Reply)
Discussion started by: thelakbe
1 Replies

5. Red Hat

scp with su

Hi Friends, I am trying to copy some files over the network in between my linux servers. I am using scp command for this. by default direct ssh root login is disabled on all of my linux servers. Normaly we used to login as a normal user and the su to th root user. unfortunately root user is... (1 Reply)
Discussion started by: arumon
1 Replies

6. Shell Programming and Scripting

SCP, Remove and Move files

I tried to automate moving files with the script below. I spent hours of research on the net creating what I have so far. Scripting does not come easy for me so any help would be greatly appreciated. Thanks in advance. The files are date stamp (YYYYMMDD) in the file name when created. New files... (2 Replies)
Discussion started by: BigSky
2 Replies

7. UNIX for Advanced & Expert Users

Scp

I am trying to transfer a 10g files using scp, but I am getting timeout errors is there anywhere that I can modify a config file or something to increase the time. (4 Replies)
Discussion started by: rbizzell
4 Replies

8. UNIX for Dummies Questions & Answers

smitty, remove user, remove directory as well..

hi, i am on aix. i used smitty to remove a user.. but then found that its directory still exists.... so i have to remove the directory manually... am i doing it the right way? (2 Replies)
Discussion started by: yls177
2 Replies

9. UNIX for Dummies Questions & Answers

scp

How do i use scp to copy a file from my home directory on a server I am logged into, to the computer I am using? I thought it would be something like: scp filename mycomp.company.org Thanks. (2 Replies)
Discussion started by: ignus7
2 Replies
Login or Register to Ask a Question