/* REXX */ /* This is backing up all accounts using Info ZIP, creating separate ZIP files for each account and one ZIP file of the files found in the ACCOUNTS directory. The destination directory is a constant in this script. This script should be placed in the root directory of your PMMail/2 installation, where the directories ACCOUNTS, BIN, and TOOLS are located or otherwise put, there has to be an ACCOUNTS subdirectory with xyz.ACT sub-subdirectories in the current directory This script relies on Forall by Kai-Uwe Rommel which should be available at the usual places for OS/2 software e.g. on Hobbes: and also ZIP from Info-Zip available at If either one is not on the PATH, the script sends a message and terminates. */ /* Version 1.0 Copyright Lko Willms, Frankfurt am Main, Germany, mailto:lueko.willms@t-online.de */ /* edit the next line according to your conventions of where the destination directory of the backup should be placed The script then creates a subdirectory for each backup formed by the timestamp YYYYMMDD-HHMMSS */ destpath = "\backup\pmmail\accounts\" /* --------------------------------------------------- */ jetzt = TIME('N') timestamp = DATE('S')||"-"||LEFT(jetzt,2)||SUBSTR(jetzt,4,2)||RIGHT(jetzt,2) destdir = destpath||timestamp CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' CALL SysLoadFuncs forallpath = SysSearchPath('PATH', 'forall.exe') zippath = SysSearchPath('PATH', 'zip.exe') IF forallpath = '' | zippath = '' THEN DO IF forallpath = '' THEN SAY "Forall.exe not found on PATH. Get Forall.exe at " IF zippath = '' THEN SAY "ZIP.eXE not found on PATH. Get ZIP.EXE for OS/2 at " END ELSE DO erg = SysMkDir(destdir) IF erg <> 0 THEN DO SAY "Error " erg " occurred while creating " destdir END ELSE DO SAY "OK, es geht los" "zip -oS "||destdir||"\Accounts Accounts\*.*" "forall -d ACCOUNTS\*.ACT : zip -roS "||destdir||"\@N @R@S" SAY "fertig" END END EXIT /* REXX */