Let users configure Hour for backups / btrfs sync (#1762)

Signed-off-by: Martin <mayermart@users.noreply.github.com>
This commit is contained in:
Martin 2023-04-24 11:02:19 +02:00 committed by GitHub
parent be6e109230
commit 0f4de56086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 3 deletions

View File

@ -47,7 +47,7 @@ fi
EOF
chmod +x /usr/local/bin/ncp-backup-auto
echo "0 3 */${BACKUPDAYS} * * root /usr/local/bin/ncp-backup-auto >> /var/log/ncp.log 2>&1" > /etc/cron.d/ncp-backup-auto
echo "0 ${BACKUPHOUR} */${BACKUPDAYS} * * root /usr/local/bin/ncp-backup-auto >> /var/log/ncp.log 2>&1" > /etc/cron.d/ncp-backup-auto
chmod 644 /etc/cron.d/ncp-backup-auto
service cron restart

View File

@ -36,7 +36,7 @@ configure()
${SSH[@]} echo || { echo "SSH non-interactive not properly configured"; return 1; }
}
echo "0 5 */${SYNCDAYS} * * root /usr/bin/rsync -ax -e \"ssh -p $PORTNUMBER\" --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto
echo "0 ${SYNCHOUR} */${SYNCDAYS} * * root /usr/bin/rsync -ax -e \"ssh -p $PORTNUMBER\" --delete \"$DATADIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-rsync-auto
chmod 644 /etc/cron.d/ncp-rsync-auto
service cron restart

View File

@ -62,7 +62,7 @@ configure()
[[ "$COMPRESSION" == "yes" ]] && ZIP="-z"
echo "30 4 */${SYNCDAYS} * * root /usr/local/bin/btrfs-sync -qd $ZIP \"$SNAPDIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-snapsync-auto
echo "30 ${SYNCHOUR} */${SYNCDAYS} * * root /usr/local/bin/btrfs-sync -qd $ZIP \"$SNAPDIR\" \"$DESTINATION\"" > /etc/cron.d/ncp-snapsync-auto
chmod 644 /etc/cron.d/ncp-snapsync-auto
service cron restart

View File

@ -37,6 +37,12 @@
"suggest": "7",
"value": "7"
},
{
"id": "BACKUPHOUR",
"name": "Hour of Day to run the Backup",
"suggest": "3",
"value": "3"
},
{
"id": "BACKUPLIMIT",
"name": "Number of backups to keep",

View File

@ -29,6 +29,12 @@
"name": "Sync periodicity (in days)",
"value": "3",
"suggest": "3"
},
{
"id": "SYNCHOUR",
"name": "Hour of Day when syncing",
"value": "5",
"suggest": "5"
}
]
}

View File

@ -36,6 +36,12 @@
"name": "Sync periodicity (in days)",
"value": "1",
"suggest": "1"
},
{
"id": "SYNCHOUR",
"name": "Hour of Day when syncing",
"value": "4",
"suggest": "4"
}
]
}