I would like to write a script to scp files from 1 server to other but the problem is if scp fails maybe because of server crash or somthing like that, i would like to start scp from the last file. i dont want to copy all the files again. Any ideas?
4 Months Ago
Related Article:Need get content of ELF shell script
is a Shell Scripting discussion thread by karthickk02 that has 1 reply, was last updated 1 year ago and has been tagged with the keywords: script.
it depends on how you intend to scp files
if you scp them all at one time, a bit like you'd copy recusrsively directories, AFAIK you can't tell.
if you copy file on at a time, using a loop, you could echo filenames to a log file when scp fails
something like this, but it's much longer
for file in ./*
scp "$file" user@server || echo "$file" >>logfile