Add plain restic example
This commit is contained in:
parent
a81649d4c4
commit
1d1aee1c6a
15 changed files with 121 additions and 7 deletions
16
etc/systemd/user/restic-check@.service
Normal file
16
etc/systemd/user/restic-check@.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run restic check script for %I utilizing ~/.config/restic/%I-check.sh file using env ~/.config/restic/%I.env
|
||||||
|
OnFailure=systemd_failure_notify@%n.service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Requires=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=sh %h/.config/restic/%I-check.sh
|
||||||
|
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
|
||||||
|
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
|
||||||
|
EnvironmentFile=%h/.config/restic/%I.env
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
9
etc/systemd/user/restic-check@.timer
Normal file
9
etc/systemd/user/restic-check@.timer
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run restic check script for %I utilizing HOME/.config/restic/%I-check.sh file
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=Wed 22:00:00
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
16
etc/systemd/user/restic-create@.service
Normal file
16
etc/systemd/user/restic-create@.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run restic create script for %I utilizing ~/.config/restic/%I-create.sh file using env ~/.config/restic/%I.env
|
||||||
|
OnFailure=systemd_failure_notify@%n.service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Requires=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=sh %h/.config/restic/%I-create.sh
|
||||||
|
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
|
||||||
|
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
|
||||||
|
EnvironmentFile=%h/.config/restic/%I.env
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
9
etc/systemd/user/restic-create@.timer
Normal file
9
etc/systemd/user/restic-create@.timer
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run restic create script for %I utilizing HOME/.config/restic/%I-create.sh file
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=23:00
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
16
etc/systemd/user/restic-prune@.service
Normal file
16
etc/systemd/user/restic-prune@.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run restic check script for %I utilizing ~/.config/restic/%I-check.sh file using env ~/.config/restic/%I.env
|
||||||
|
OnFailure=systemd_failure_notify@%n.service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Requires=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=sh %h/.config/restic/%I-check.sh
|
||||||
|
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
|
||||||
|
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
|
||||||
|
EnvironmentFile=%h/.config/restic/%I.env
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
9
etc/systemd/user/restic-prune@.timer
Normal file
9
etc/systemd/user/restic-prune@.timer
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run restic prune script for %I utilizing HOME/.config/restic/%I-prune.sh file
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=Wed 23:00:00
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
|
@ -1,12 +1,15 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Run resticwrapper
|
Description=Run resticwrapper
|
||||||
#OnFailure=systemd_failure_notify@%n.service
|
OnFailure=systemd_failure_notify@%n.service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
Requires=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=resticwrapper
|
ExecStart=resticwrapper
|
||||||
#ExecStart=borgwrapper /home/myUser/resticwrapper-custom.conf
|
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:%h/.bin"
|
||||||
#Environment="SSH_AUTH_SOCK=/run/user/myUserId/keyring/ssh"
|
Environment="SSH_AUTH_SOCK=/run/user/%u/keyring/ssh"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=multi-user.target
|
|
@ -2,7 +2,7 @@
|
||||||
Description=Run resticwrapper
|
Description=Run resticwrapper
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar=20:00
|
OnCalendar=23:00
|
||||||
Persistent=false
|
Persistent=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
4
sync
4
sync
|
@ -15,7 +15,7 @@ usage() {
|
||||||
echo "";
|
echo "";
|
||||||
echo "- Press 4 to list command line users for sync";
|
echo "- Press 4 to list command line users for sync";
|
||||||
echo "";
|
echo "";
|
||||||
echo "- Press 5 to sync the git folder's '/usr/local/bin' with system's '/usr/local/bin'";
|
echo "- Press 5 to sync the git folder's '/usr' with system's '/usr'";
|
||||||
echo "---";
|
echo "---";
|
||||||
echo "Press 0 or [CTRL+C] to exit";
|
echo "Press 0 or [CTRL+C] to exit";
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ menu() {
|
||||||
echo $u;
|
echo $u;
|
||||||
done
|
done
|
||||||
elif [ "$menuInput" = "5" ]; then
|
elif [ "$menuInput" = "5" ]; then
|
||||||
sudo rsync -r -t -v --chown=root:root --progress $(pwd)/usr/local/bin/ /usr/local/bin/
|
sudo rsync -r -t -v --chown=root:root --progress $(pwd)/usr/ /usr/
|
||||||
echo "";
|
echo "";
|
||||||
elif [ "$menuInput" = "0" ]; then
|
elif [ "$menuInput" = "0" ]; then
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
3
usr/share/doc/restic/mybackup-check.sh
Executable file
3
usr/share/doc/restic/mybackup-check.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
/usr/bin/restic check
|
11
usr/share/doc/restic/mybackup-create.sh
Executable file
11
usr/share/doc/restic/mybackup-create.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
/usr/bin/restic backup \
|
||||||
|
--one-file-system \
|
||||||
|
--exclude-file /home/myuser/.config/restic/mybackup.exclude \
|
||||||
|
--files-from /home/myuser/.config/restic/mybackup.include
|
||||||
|
|
||||||
|
/usr/bin/restic forget \
|
||||||
|
--keep-daily 7 \
|
||||||
|
--keep-weekly 4 \
|
||||||
|
--keep-monthly 3
|
3
usr/share/doc/restic/mybackup-prune.sh
Executable file
3
usr/share/doc/restic/mybackup-prune.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
/usr/bin/restic prune
|
14
usr/share/doc/restic/mybackup.env
Normal file
14
usr/share/doc/restic/mybackup.env
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# If you're using sftp with a special key, it's recommended to set an
|
||||||
|
# alias for the specific host and use it in the repository name
|
||||||
|
#
|
||||||
|
# ~/.ssh/config
|
||||||
|
# Host restic-mybackup
|
||||||
|
# HostName 192.168.1.2
|
||||||
|
# Port 22
|
||||||
|
# User backup
|
||||||
|
# IdentityFile ~/.ssh/backup
|
||||||
|
|
||||||
|
RESTIC_CACHE_DIR="..."
|
||||||
|
RESTIC_PASSWORD="..."
|
||||||
|
#RESTIC_REPOSITORY="sftp://restic-mybackup//my/remote/path"
|
||||||
|
RESTIC_REPOSITORY="..."
|
3
usr/share/doc/restic/mybackup.exclude
Normal file
3
usr/share/doc/restic/mybackup.exclude
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
/home/lost+found
|
||||||
|
/home/**/.cache
|
||||||
|
*.bak/**
|
2
usr/share/doc/restic/mybackup.include
Normal file
2
usr/share/doc/restic/mybackup.include
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/home/myuser
|
||||||
|
/etc
|
Loading…
Reference in a new issue