diff --git a/tools/backups/backup_rotation.sh b/tools/backups/backup_rotation.sh index cfab628dff..a4b4a826e5 100755 --- a/tools/backups/backup_rotation.sh +++ b/tools/backups/backup_rotation.sh @@ -11,10 +11,10 @@ # Must contain backup.monthly backup.weekly backup.daily backup.hourly folders storage="$1" -NB_HOURLY=48 # nb de sauvegardes horaires a conserver (1 par heure) -NB_DAILY=40 # nb de sauvegardes quotidiennes a conserver -NB_WEEKLY=30 # nombre de sauvegardes hebdomadaires a conserver -NB_MONTHLY=200 # nombre de sauvegardes mensuelles a conserver +NB_HOURLY=24 # nb de sauvegardes horaires a conserver (1 par heure) +NB_DAILY=7 # nb de sauvegardes quotidiennes a conserver +NB_WEEKLY=4 # nombre de sauvegardes hebdomadaires a conserver +NB_MONTHLY=12 # nombre de sauvegardes mensuelles a conserver # Work in backup directory: cd $storage diff --git a/tools/etc/scodoc-backup-db.service b/tools/etc/scodoc-backup-db.service new file mode 100644 index 0000000000..d17e7a1ad9 --- /dev/null +++ b/tools/etc/scodoc-backup-db.service @@ -0,0 +1,18 @@ +# +# Systemd service to backup ScoDoc postgresql database +# +# Put this file in /etc/systemd/system, along with scodoc-updater.timer +# and then run +# systemctl enable scodoc-updater.timer +# systemctl start scodoc-updater.timer +# +# E. Viennet jun 2019 +# + +[Unit] +Description=Update ScoDoc Software + +[Service] +Type=oneshot +ExecStart=/opt/scodoc/tools/backup_db9 SCODOC + diff --git a/tools/etc/scodoc-backup-db.timer b/tools/etc/scodoc-backup-db.timer new file mode 100644 index 0000000000..68a22c3837 --- /dev/null +++ b/tools/etc/scodoc-backup-db.timer @@ -0,0 +1,16 @@ +# +# Systemd service to upgrade ScoDoc +# +# Put this file in /etc/systemd/system, along with scodoc-updater.service +# +# E. Viennet oct 2023 +# + +[Unit] +Description=Dump ScoDoc database each hour (*:07) + +[Timer] +OnCalendar=*-*-* *:07:00 + +[Install] +WantedBy=timers.target