From 45053bea64d6bdc3fc6e34394f36b81d3c43aff3 Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Tue, 4 Jun 2019 02:11:06 +0500 Subject: [PATCH] Add example unit files --- systemd/backup_configs.service | 11 +++++++++++ systemd/backup_configs.timer | 8 ++++++++ systemd/backup_postgresql.service | 12 ++++++++++++ systemd/backup_postgresql.timer | 8 ++++++++ 4 files changed, 39 insertions(+) create mode 100644 systemd/backup_configs.service create mode 100644 systemd/backup_configs.timer create mode 100644 systemd/backup_postgresql.service create mode 100644 systemd/backup_postgresql.timer diff --git a/systemd/backup_configs.service b/systemd/backup_configs.service new file mode 100644 index 0000000..558213d --- /dev/null +++ b/systemd/backup_configs.service @@ -0,0 +1,11 @@ +[Unit] +Description=Run backups on service configurations and Docker volumes + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/backup.sh -c -d +User=root +WorkingDirectory=/tmp + +[Install] +WantedBy=default.target diff --git a/systemd/backup_configs.timer b/systemd/backup_configs.timer new file mode 100644 index 0000000..2c73fd8 --- /dev/null +++ b/systemd/backup_configs.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run backups on service configurations and Docker volumes + +[Timer] +OnCalendar=*-*-* 4:00:00 + +[Install] +WantedBy=timers.target diff --git a/systemd/backup_postgresql.service b/systemd/backup_postgresql.service new file mode 100644 index 0000000..1cc8e1d --- /dev/null +++ b/systemd/backup_postgresql.service @@ -0,0 +1,12 @@ +[Unit] +Description=Run backups on PostgreSQL databases + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/backup.sh -p +User=postgres +Group=postgres +WorkingDirectory=/tmp + +[Install] +WantedBy=default.target diff --git a/systemd/backup_postgresql.timer b/systemd/backup_postgresql.timer new file mode 100644 index 0000000..d10d67a --- /dev/null +++ b/systemd/backup_postgresql.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run backups on PostgreSQL databases + +[Timer] +OnCalendar=*-*-* 4:00:00 + +[Install] +WantedBy=timers.target