Skip to content

Commit 76ba6c2

Browse files
author
Victor Bouvier-Deleau
committed
Optionnaly chown the backup file
1 parent 0a349d4 commit 76ba6c2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

config_backup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ if [[ "$(sqlite3 /data/freenas-v1.db "pragma integrity_check;")" == "ok" ]]; the
3434
# Also store it somewhere that will be backed up by another service.
3535
if [[ "${BACKUP_FILE_PATH}" != "" ]]; then
3636
cp "${TAR_FILE}" "${BACKUP_FILE_PATH}"/"${BACKUP_FILE_NAME}".tar.gz
37+
if [[ "${BACKUP_FILE_OWNER}" != "" ]]; then
38+
chown "${BACKUP_FILE_OWNER}" "${BACKUP_FILE_PATH}"/"${BACKUP_FILE_NAME}".tar.gz
39+
fi
3740
fi
3841
rm /tmp/"${BACKUP_FILE_NAME}".db
3942
rm /tmp/"${BACKUP_FILE_NAME}".db.sha256

user.example.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# If you don't want to store your config backup somewhere on your FreeNAS filesystem you can just leave this variable
33
# empty like: readonly BACKUP_FILE_PATH=""
44
readonly BACKUP_FILE_PATH="/path/to/freenas/db/backup/dir"
5+
# Change the owner of the file, leave empty ("") if not desired
6+
readonly BACKUP_FILE_OWNER="myuser"
57

68
# SMART report
79
readonly DRIVE_TEMPERATURE_WARNING=40 # Degrees Celsius

0 commit comments

Comments
 (0)