[GH-ISSUE #29] Optional pre-restore snapshot #3

Closed
opened 2026-03-04 19:17:15 +03:00 by kerem · 0 comments
Owner

Originally created by @codesterribly on GitHub (Nov 15, 2025).
Original GitHub issue: https://github.com/007revad/Linux_Plex_Backup/issues/29

In Restore_Linux_Plex_Backup.sh, before you untar into Plex_Data_Path, offer an optional “safety backup” of the current data:

# Before restore
if [[ ${CREATE_SAFETY_SNAPSHOT,,} == "yes" ]]; then
    safety_name="${Nas}_$(date '+%Y%m%d-%H%M')_Plex_PRE_RESTORE.tgz"
    echo "Creating safety snapshot at ${Backup_Directory}/${safety_name}" |& tee -a "${Log_File}"
    tar -cvpzf "${Backup_Directory}/${safety_name}" -C "${Plex_Data_Path}" "Plex Media Server/" \
        2> >(tee -a "${Log_File}" "${Tmp_Err_Log_File}" >&2)
fi

Then add CREATE_SAFETY_SNAPSHOT=yes|no to the config. Default to no so you do not surprise people.

Originally created by @codesterribly on GitHub (Nov 15, 2025). Original GitHub issue: https://github.com/007revad/Linux_Plex_Backup/issues/29 In Restore_Linux_Plex_Backup.sh, before you untar into Plex_Data_Path, offer an optional “safety backup” of the current data: ``` # Before restore if [[ ${CREATE_SAFETY_SNAPSHOT,,} == "yes" ]]; then safety_name="${Nas}_$(date '+%Y%m%d-%H%M')_Plex_PRE_RESTORE.tgz" echo "Creating safety snapshot at ${Backup_Directory}/${safety_name}" |& tee -a "${Log_File}" tar -cvpzf "${Backup_Directory}/${safety_name}" -C "${Plex_Data_Path}" "Plex Media Server/" \ 2> >(tee -a "${Log_File}" "${Tmp_Err_Log_File}" >&2) fi ``` Then add CREATE_SAFETY_SNAPSHOT=yes|no to the config. Default to no so you do not surprise people.
kerem closed this issue 2026-03-04 19:17:15 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Linux_Plex_Backup#3
No description provided.