Hi Ronan,

Here is the script in it's functioning state. You can easily modify it to your specs. It's not very complicated.

Marny thanks, again, to all who helped out on this project.

Mark

------------------------------------------------------------------------ ---------------------
#!/usr/bin/perl -w


use strict;
use File::Copy;

# Name of files to copy, as many as you need
my @dbname = ("db1.txt","db2.txt","db3.txt","db4.txt");

# Pathway after the main server name - Pathways must match the files above, array number for array number
my @dbpath = ("pathway/to/files","pathway/to/files","pathway/to/files","pathway/to/ files");


# Basic root directory for where the files will be copied TO
my $dirto = "/Volumes/OEMWorkgroup\;OEMCOMPUTER/"; # Example of the root server path to a shared folder on a PC


# Basic root directory for where the files will be copied FROM
my $dirfrom = "/Users/xxxxxx/Documents/";

my ($backup, $i);

my $timetest = time;

my ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime($timetest);
$year = substr(1900 + $year,2,2);
$mon++;
if ($mon  < 10) { $mon  = "0$mon";  }
if ($mday < 10) { $mday = "0$mday"; }
my $date = "$mon-$mday-$year";

for ($i=0; $i<=$#dbname; $i++) {
$backup = "$dbname[$i]-$date.bak";
copy ("$dirfrom$dbpath[$i]/$dbname[$i]", "$dirto$backup") or warn "Can't copy file $dirfrom$dbpath[$i]/$dbname[$i] to $dirto$backup - $!\n";
if (-e "$dirto$backup") {
print "$dbname[$i] backed up.\n";
} else {
print "$dbname[$i] NOT backed up!\n";
}
}


print "Backup Complete.\n";

------------------------------------------------------------------------ --------

On May 2, 2004, at 5:57 PM, Ronan O Ciosoig wrote:

did you get this up and running?

I need to get a backup script running myself now as well on a Win2k server. Not sure how to do it. What's the equivalent to cron on Windows?

Thanks.

On 29 Apr 2004, at 04:28, Mark Wheeler wrote:

Hi Ronan,

Could you elaborate? I'm not familiar with 'scp'.

Thanks,

Mark


On Apr 28, 2004, at 1:22 AM, Ronan O Ciosoig wrote:

You should use 'scp' - secure copy or ftp.


scp /path/to/file [EMAIL PROTECTED]:/Users/username/path/to/backup

or something like that.

Ronan.






Reply via email to