From 57af2b88dfe5e8b6f5cfa8da355d8741ca139d7a Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sun, 25 Feb 2024 19:10:19 +0300 Subject: [PATCH] Save : Return the save feature. --- .../system/module/common/bash/module/Save.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .config/linux/system/module/common/bash/module/Save.sh diff --git a/.config/linux/system/module/common/bash/module/Save.sh b/.config/linux/system/module/common/bash/module/Save.sh new file mode 100644 index 0000000..a1060df --- /dev/null +++ b/.config/linux/system/module/common/bash/module/Save.sh @@ -0,0 +1,19 @@ +# Backup a game save. +# Usage: save [TARGETS] +function save() { + local IFS=$'\n' + local targets=("${@}") + local files=() + [[ "${targets}" = "" ]] && targets=($(_ls_dir)) + + _info "Archiving..." + for target in ${targets[@]}; do + files+=($(archive "${target}")) + done + + _info "Uploading..." + try rcp "${files[@]}" home:/storage/cold_1/backup/save/ + + _info "Cleaning..." + archive_prune +}