Create an array of all the files to be considered: @all_files
Make sure you skip "." ".." backup.tar backup.*.tar backup.times
If backup.times does not exist, create a tar of all the files in @all_files
If backup.times does exist
read backup.times into a hash
for each file in @all_files
if not in hash, or has a modification time greater than that in the hash,
add to @modified
create a tar file of all the files in @modified
Create the backup.times file, put an entry for each file in @all_files: <filename,mtime>
The package
File::Find provides a mechanism for recursively traversing directories
The function
system passes a command to /bin/sh to be executed. For example:
system "tar -cf $filename @files";
will use the UNIX
tar utility to create a .tar file called $filename with all the files in @files
You need to use the
stat function to get modification times. Copy the prototype for using it from a web page.
Break the problem into pieces and get the pieces working independently of the entire program.