#!/usr/bin/perl # Perl script # This will read the desktop important folders and the "Sites" folder # and back them up, the list is contained in a file giving the list # of folders or directories to backup. # #Opening files and reading data and doing something with it. $file = shift (@ARGV); open(FILE,$file) || die "Usage: perl do_tar_backup ... Please make sure you typed proper name \n"; chop(@lines = ); close(FILE); print "Processing Folder List: $file ....Wait\n"; foreach $line (@lines){ # Note, the next lines do the tarring (tar) operation but # leave the file in the directory where it was found. # Please be aware of this for now. All will go to the desktop # except for one under /Users/victor/Sites which will be # stored in the directory /Users/victor . $dotar= "tar cvf $line.tar $line"; print "Done Tarring....", `$dotar`, "\n"; print " moving TARS from desktop and Sites to Archive ", "\n"; } # Move all the desktop files to Archive (current directory) # Note the current directory is defined as a ".", UNIX is quite terse! $mvtar= " mv /Users/victor/Desktop/*.tar . "; # Move the Sites file in the /Users/victor Folder to archive # (curent directory) $mvtar2= " mv /Users/victor/*.tar . "; print "Finished moving tared files .." , `$mvtar`, `$mvtar2`, "\n"; print "\n"; exit;