Copying and renaming file using SCP
Posted on 2012-08-30
I wish to be able to copy a backup file from a hosted linux server to our windows server running Cygwin in the office. I've set this up and can copy manually, i now wish to create a script to automate this.
This is how far i have got:
scp test.dat ftpuser@IPADDRESS:/home/ftpuser/Backup
What i wish to do is for the script to rename the file once it reaches the destination with the date and time in the file name, so the file name in this example would be test-30082012-1500.dat
i've set up the keys and am able to connect without using a password. it's just the file rename i'm struggling with.
Thanks in advance.