Script for backup the file and append the status of the copy in to the file with date and time
January 31, 2011 at 7:24 am | Posted in shell script | Leave a commentroot@test-server:~# cat a.sh
rsync -r -v /root/known_hosts /testing | sed “s/$/, $(date)/” >>/home/hariprakash/ab.txt
sed “s/$/, $(date)/” ==> append the date and time to the file
OUTPUT LOG:
root@test-server:~# cat /home/hariprakash/ab.txt
sending incremental file list,Sat Jan 29 15:54:08 IST 2011
known_hosts,Sat Jan 29 15:54:08 IST 2011
,Sat Jan 29 15:54:08 IST 2011
sent 10685 bytes received 31 bytes 21432.00 bytes/sec,Sat Jan 29 15:54:08 IST 2011
total size is 10608 speedup is 0.99,Sat Jan 29 15:54:08 IST 2011
sending incremental file list,Sat Jan 29 15:54:25 IST 2011
known_hosts,Sat Jan 29 15:54:25 IST 2011
,Sat Jan 29 15:54:25 IST 2011
sent 10685 bytes received 31 bytes 21432.00 bytes/sec,Sat Jan 29 15:54:25 IST 2011
total size is 10608 speedup is 0.99,Sat Jan 29 15:54:25 IST 2011
Leave a Comment »
RSS feed for comments on this post. TrackBack URI
Leave a Reply
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.