1 | Did do a backup. |
0 | Did not do a backup. |
FilePathValue | File path for the original file. |
Extension | Optional. Name of the extension the backup version should get. Defaults to bak. |
This command is meant to be paired with RestoreIfExists to make for a very primitive, "one version only" backup mechanism to use with applications.
% String2File "testing 1 2 3" test.txt
% cat test.txt
testing 1 2 3
% BackupIfExists test.txt
Copying test.txt to test.txt.bak
1 file(s) copied.
% cat test.txt.bak
testing 1 2 3