O__backupData
Purpose: Backs up a file, and optionally deletes the original after backing up.
Type: Server-side function
Inputs:
- $target: The path to the file to be backed up.
- $delete: If the value is one, delete the original file.
Outputs: Backed up file is stored in the /DB/backups directory.
Use Case: Call O__backupData whenever you are saving a newer version of a file and needing to save the previous revision, or when you are deleting the original from production use.
Examples:
- Back up without deleting: O__backupData("/path/to/my/file.txt",0);
- Back up AND delete: O__backupData("/path/to/my/file.txt",1);
Version Documented: 20180409