Now as far as using that list of files to make backup copies, what would be the best thing to do?
All that comes to mind right now is a PHP script:
#!/usr/bin/php
<?php
$fh = fopen("includelist.txt","r");
while ($source = fgets($fh))
{
copy($source, $destination); // needs error checking
}
fclose($fh);?>
But PHP doesn't seem like the best thing for this. What do you think?
Richard
On Nov 19, 2003, at 12:11 AM, Richard Esplin wrote:
grep -v will do an invert match, only returning the files that don't contain
the specified strings. You could then send that list to cp to make your
backups (make sure to use the -p flag to preserve permissions).
But unison is a tool that will do exactly what you want. If you put your list
of files in the ignore list in your preferences file, then unison will never
touch them. unison has a lot of other features too, so perhaps it is overkill
for your purposes.
Richard Esplin
On Tuesday 18 November 2003 23:24, Richard Miller wrote:I want to backup my Home directory but there are some files that I just
don't need to backup so I have compiled a list in "excludelist.txt".
I'm not a pro with Regular expressions, but I've learned that I can
type a command like this
$ find ~ | grep -f excludelist.txt
to show the all the files I want to exclude.
How do I, on the other hand, use the exclude list to show all of the files I want to INCLUDE?
Actually, I don't know what I will do with a list of the files I want to include, but there ought to be a way to backup those files once I have a list. Am I heading in the right direction?
Thanks!
Richard Miller
____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
____________________ BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________ List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
