Scp with rename existing file.

420 views
Skip to first unread message

Amit Kokitkar

unread,
Sep 5, 2013, 12:43:22 PM9/5/13
to VGLUG
Hi Experts,

I create script which copy file on required path to remote location but how can i rename existing file on remote server within script.

Thanks in advance....

Amit Kokitkar

Alpesh Bhavsar

unread,
Sep 5, 2013, 1:12:38 PM9/5/13
to vg...@googlegroups.com
Hi Amit,

Have you decided any particular pattern of destination file name?

Regards,
Alpesh



Amit Kokitkar

--
Please read http://www.catb.org/~esr/faqs/smart-questions.html before posting.
You received this message because you are subscribed to the "Vibrant GNU/Linux User Group".
To stop receiving emails from this group, mail to VGLUG+un...@googlegroups.com
To post to this group, send email to VG...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/VGLUG

---
You received this message because you are subscribed to the Google Groups "VGLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vglug+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Amit Kokitkar

unread,
Sep 6, 2013, 12:25:06 AM9/6/13
to vg...@googlegroups.com
Hi,

Basically there are source code file, i want rename existing file and then paste new one with scp..

Amit Kokitkar

Alpesh Bhavsar

unread,
Sep 6, 2013, 2:40:03 AM9/6/13
to vg...@googlegroups.com
I would suggest to rename existing file with shell script and then transfer it to new location. You can use shell script to rename file. Below command can be useful.

find /sourcecode_location/ -type f -exec mv {} {}.`date | md5sum | awk '{ print $1 }'` \;

Regards,
Alpesh

amit kokitkar

unread,
Sep 6, 2013, 10:37:50 AM9/6/13
to vg...@googlegroups.com
hi,

thanks for help, i use resync with b flag wich take backup of existing file.

Amit Kokitkar
9867895689
Reply all
Reply to author
Forward
0 new messages