Simple Deno backup scripts for file and folder backups.
- Backup:
deno task backup <config-path> - Restore:
deno task restore <backup-directory> - Test:
deno task test
backup-dir = "./backup_${os}_${date}_${count}"
[[tasks]]
src = ["/path/to/source"]
dest = "target"The backup task supports these copy modes:
-
Single file to destination file
- Example:
src = ["/a/file.txt"],dest = "file.txt" - Result: copied directly as
<backup-dir>/file.txt
- Example:
-
Single file to destination folder
- Example:
src = ["/a/file.txt"],dest = "files" - Result:
<backup-dir>/files/file.txt
- Example:
-
Single folder to destination folder
- Example:
src = ["/a/folder"],dest = "folder-copy" - Result: folder content is copied as
<backup-dir>/folder-copy/...
- Example:
-
Multiple files/folders (mixed) to destination folder
- Example:
src = ["/a/file.txt", "/a/folder"],dest = "bundle" - Result: each source is copied under
<backup-dir>/bundle/
- Example:
-
Compression to 7zip
- If destination ends with
.7z, sources are compressed. - Example:
dest = "bundle.7z"
- If destination ends with
before-command(array): commands to run before backup copy/compresscommands(array, withtype = "command"): command-only taskos(array): run task only on matching OSrestore(bool): include or skip this task during restorefilter-source(bool): disable source filtering if set tofalse
[[tasks]]
type = "command"
commands = ["date > /tmp/backup-date.txt"]