/*********************************************************************** This program makes a 7 day incremental backup of directory 'c:\home' to the 'x:\...\RsyncBackup\Backups\Local\Incremental\Weekly\Home' 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. 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' /*********************************************************************** * Where should the backup be saved? */ BackupLocaion='c:\Programs\RsyncBackup\Backups\Local\Incremental\Weekly\Home' /*********************************************************************** * excludes file */ /* 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 (--suffix=_"BackupTime ) */ 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 || " " || BackupLocaion 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 '' 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 local resource.' say "" say "" say 'The files will be located in: ' say color.green || BackupLocaion || color.gray say '' say '' say color.red || 'Continue? Y/n' || color.gray pull YesNo if \ (YesNo = "Y") then exit RETURN