Register
It is currently Sat Aug 30, 2014 10:22 pm

rsync script to rewrite suffix - BASH, awk, sed, perl?


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Wed Mar 20, 2013 12:40 pm   

Joined: Wed Mar 20, 2013 12:37 pm
Posts: 1
trying to write up a script to put the suffix back.

heres what I have but can't get it to do anything :(

would like it to be name.date.suffix

Code:
rsync -zrlpoDtub --suffix=".`date +%Y%m%d%k%M%S`.~" --bwlimit=1024  /mymounts/test1/ /mymounts/test2/



Code:
while IFS=. read -r -u 9 -d '' name suffix date tilde
do
    mv "${name}.${suffix}.${date}.~" "${name}.${date}.${suffix}"
done 9< <(find . -type f -name "*.~" -print0)


Code:
rsync -zrlpoDtub --suffix=".`date +%Y%m%d%k%M%S`.~" --bwlimit=1024  /mymounts/test2/ /mymounts/test1/


Code:
while IFS=. read -r -u 9 -d '' name suffix date tilde
do
    mv "${name}.${suffix}.${date}.~" "${name}.${date}.${suffix}"
done 9< <(find . -type f -name "*.~" -print0)


Edit: There was an error in the rsync suffix that I have edited- put ".

getting renames as "test2.txt.20130320 95325.~"
its writing
Thanks in advance,


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP