Every night Monday - Friday we have backups on the core system. It creates 3 backup files and i would like to find a script that i can set to run every night to copy the current date files to a network server to keep, We dont use tapes anymore so i have to manually copy these files every night. I know absolutly nothing about writing scripts so any help would be very appreciated
pre.db.store.mon.20130603.1658.gz
pre.ndb.store.mon.20130603.1658.gz
pre.toc.store.mon.20130603.1658.gz
pre.db.store.mon.20130603.1658.gz
pre.ndb.store.mon.20130603.1658.gz
pre.toc.store.mon.20130603.1658.gz
Hello,
Try this example:
[scriptftp="backup1.ftp"]# Connect
OPENHOST("the_ip_address_of_the_core_system_here","myuser","mypassword")
# Change current local directory
LOCALCHDIR("C:\Backup")
# Change the current remote directory
CHDIR("/path/to/important/files")
# The files are
$filename1= "pre.db.store.mon.".GETTIME(FORMAT3).".1658.gz"
$filename2= "pre.ndb.store.mon.".GETTIME(FORMAT3).".1658.gz"
$filename3= "pre.toc.store.mon.".GETTIME(FORMAT3).".1658.gz"
# Download
GETFILE($filename1)
GETFILE($filename2)
GETFILE($filename3)
CLOSEHOST()[/ScriptFTP]
Or even simple, If you just want to download any file that has the date in the filename:
[scriptftp="backup2.ftp"]OPENHOST("the_ip_address_of_the_core_system_here","myuser","mypassword")
# Change current local directory
LOCALCHDIR("C:\Backup")
# Change the current remote directory
CHDIR("/path/to/important/files")
# Download any file with the date in the file name
GETFILE("*".GETTIME(FORMAT3).".*")
CLOSEHOST()[/ScriptFTP]
Try this example:
[scriptftp="backup1.ftp"]# Connect
OPENHOST("the_ip_address_of_the_core_system_here","myuser","mypassword")
# Change current local directory
LOCALCHDIR("C:\Backup")
# Change the current remote directory
CHDIR("/path/to/important/files")
# The files are
$filename1= "pre.db.store.mon.".GETTIME(FORMAT3).".1658.gz"
$filename2= "pre.ndb.store.mon.".GETTIME(FORMAT3).".1658.gz"
$filename3= "pre.toc.store.mon.".GETTIME(FORMAT3).".1658.gz"
# Download
GETFILE($filename1)
GETFILE($filename2)
GETFILE($filename3)
CLOSEHOST()[/ScriptFTP]
Or even simple, If you just want to download any file that has the date in the filename:
[scriptftp="backup2.ftp"]OPENHOST("the_ip_address_of_the_core_system_here","myuser","mypassword")
# Change current local directory
LOCALCHDIR("C:\Backup")
# Change the current remote directory
CHDIR("/path/to/important/files")
# Download any file with the date in the file name
GETFILE("*".GETTIME(FORMAT3).".*")
CLOSEHOST()[/ScriptFTP]
liked Script FTP? Try our other product Email Parser