/*********************************************************************** This program makes a 7 day incremental backup of directory 'c:\home' to the 'x:\RsyncBackup\Backups\Network\WS001\Incremental\Weekly\...' Greggory Shaw, USA, November 2016 This script serves as a template for RsyncBackup. Make a copy of this program to User_Scripts diectory, then modify to suit your needs. *** IMPORTANT *** IMPORTANT *** IMPORTANT *** The following entry is needed in rsyncd.conf on the rsync server: [RsyncInt] # hosts allow = 192.168.1.1/24 comment = Rsync Incremental backup path = e:/RsyncBackup/Backups/Network read only = false list = yes gid = root uid = root USAGE: stand alone or remove the statement, 'Call Banner' for automated backups with a scheduler. REMEMBER: to remove the '--dry-run' option to ENABLE actual changes. *** DO NOT MODIFY (UPGRADING WILL OVERWRITE), COPY TO USER_SCRIPTS *** ***********************************************************************/ Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs' Call SysLoadFuncs Version = '1.1' Date = '21 November 2016' CurrentDir = directory() /*********************************************************************** * Directory to backup !! */ BackupDir='c:\Home' /*********************************************************************** * What module should Rsync use on the server */ ServerMod='RsyncInt' /*********************************************************************** * Where should the backup be saved? */ ServerDir='\WS001\Incremental\Weekly\Home' /*********************************************************************** * The name of the Rsync backup server */ BackupServer= 192.168.1.100 /* excludes file - this contains a wildcard pattern per line of files to exclude. */ /*********************************************************************** * Get the name of the day; use it for current backup directory */ BackupDay=Date('W') BackupDate=Date('S') BackupTime=Time(Minutes) /*********************************************************************** * Options & Banner */ Opts = ' --dry-run --archive --itemize-changes --os2-perms --stats --xattrs --backup --backup-dir=' CALL Color CALL Banner /*********************************************************************** * Now the actual transfer */ rsync || Opts || BackupDay || "/" || BackupDate || "/" || " " || BackupDir || " " || BackupServer ||"::" || ServerMod || ServerDir say "Successful backup of program objects" pause EXIT 0; Color: /***********************************************************************/ /* Set some colors, thanx to Dmitry A.Steklenev for the inspiration */ /* enable ANSI extended screen and keyboard control */ /***********************************************************************/ '@ansi on > nul' color.brown = "1B"x"[0;33m" color.red = "1B"x"[1;31m" color.green = "1B"x"[1;32m" color.yellow = "1B"x"[1;33m" color.blue = "1B"x"[1;34m" color.magenta = "1B"x"[1;35m" color.cyan = "1B"x"[1;36m" color.white = "1B"x"[1;37m" color.gray = "1B"x"[0m" RETURN Banner: /******************************************************************************/ say color.gray || 'Thank you for using '|| color.magenta || 'RsyncIncremental' ||, color.gray || ', a backup tool for your OS/2 System.' say '' say color.gray || 'Copyright (c) 2016 by '|| color.white || 'Greggory Shaw' say '' say color.cyan || 'Version 'Version || color.gray || ' -' Date say '' say color.gray || 'This program creates a 7 day Incremental backup of '|| color.green || BackupDir || color.gray || ' directory' say 'using Rsync to a central backup server.' say "" say "The 'BackupServer' value needs to be changed to the IP address " say 'of your server currently set to: ' || color.green || BackupServer || color.gray say "" say 'The files will be located in: ' say color.green || 'Rsyncbackup\Backups\Network' || ServerDir || color.gray say '' say '' say color.red || 'Continue? y/n' || color.gray pull YesNo if \ (YesNo = "Y") then exit RETURN