23 July 2012

bash script: copy to server, files that are modified today

(all in one line)

find * -mtime 0 -printf "%p " | 
awk '{print "scp -i sshid "$0" user@hostname:/path"}' | sh

copy files modified after 13 days ago
find * -mtime -13 -printf "%p " | awk '{print "cp -p "$0" ~/folder "}' | sh

No comments:

Post a Comment