backup

is there a script that will do the following

1) i have two folders.I use one and the others a backup.can i get a script (perl script for win98) that whenever i put stuf into one folder it will back it up to the backup folder

perl is not my domain but...

you need to have a daemon service for that... what you are asking is an event driven back up... I know a command line application for NT called "Hannibal" (which of course is not free) which can sniff events such as file creations/modifications on certain watched folders on watched drives on watched machines and so on...

the only other recourse it seems is writing your own daemons for such events...

Cheers!
Vishnu.

OK - this sounds VERY much like a homework question! However, I'll give you the gist of teh script - which is UN-TESTED!!!

It's a crude answer to your question, so it wont backup amended files (you'll have to add the code for that). All it will do is make a copy of any new file created in the target directory! Make sure you test it, etc....

#!/perl/bin/perl

# --------------------------------------------------------------
# Creates a backup in a specified folder of each file in a
# target folder


#set this to your backup folder
$backupFolder = "c:\backup";

#set this to the folder you want to track
$trackFolder = "c:\documents";

while (1) {
  opendir(TARGETFOLDER, $trackFolder);
  @files = readdir(TARGETFOLDER);
  closedir(TARGETFOLDER);

  opendir(BACKUPFOLDER, $backupFolder);
  @filesToo = readdir(BACKUPFOLDER);
  closedir(BACKUPFOLDER);
  
  $found = 0;
  
  # compare files found within each folder
  foreach $targetFile (@files) {
    foreach $backupFile (@filesToo) {
      if ($targetFile eq $backupFile) {
        $found = 1;
      }
    }

    if ($found == 0) {
      system "copy ${trackFolder}\\${targetFile} ${backupFolder}";
    }

  }
  # sleep for 10 minutes before comparing files again
  sleep 600;
}

Thanks. Its not homwork. IAM only 14 years old!

Not studying computer science yet !!!