I have been using the following small script to help
locate backed up files and list (ls) related info.
Here it is if anyone find it useful:
====Begin====
#!/bin/bash
echo ""
echo "Enter file to search for:"
read filename
locate -i $filename > /tmp/locate_list
echo ""
cat /tmp/locate_list | while read line; do ls -lih
"${line}"; done
echo ""
#
# Use "${line}" instead of just ${line} because locate
# returns a list of files and paths included spaces.
# For ls quotes or or an escape (\) is needed to treat
# a space as just that.
#
rm /tmp/locate_list
echo "Steps to restore a file and ownership:"
echo "1- scp -p <backup1/path/file>
root < at > filesrv1:<filesrv1/path/file>"
echo "2- ssh root < at > filesrv1 chown <00000:00000>
<filesrv1/path/file>"
echo ""
====Begin ====
I welcome any suggested improments to the script.
And can anyone comment on the following:
1 - How do turn line wrapping off on my terminals
(Konsole or gnome-terminal)? My file paths are very
long and resulting line wrapping makes the output
difficult to read.
2 - What is the easiest way from a terminal to copy a
file back to its source with the same mode and
ownership. Is there a better way than my 2 step method
above?
Thanks for any comments.
Bruce
____________________________________________________________________________________
Have a burning question?
Go to www.Answers.yahoo.com and get answers from real people who know.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
