feat: add new templates
Added new templates related to backup tasks `rclone.conf.j2` - rclone.conf template to set up remotes for restic repos. these are setup specifically for gdrive with a private client id. `restic-backup.service.j2` and `restic-prune.service.j2` are used to define daily backups and weekly prunes as systemd services respecfully.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{% for remote in rclone_remotes %}
|
||||
[{{ remote.remote_name }}]
|
||||
type = drive
|
||||
client_id = {{ remote.client_id }}
|
||||
client_secret = {{ remote.client_secret }}
|
||||
scope = drive
|
||||
token = {{ remote.client_auth_token }}
|
||||
team_drive = {{ remote.team_drive_id }}
|
||||
root_folder_id =
|
||||
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Restic Backup: {{ backup_name }}
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
Environment=RESTIC_REPOSITORY={{ restic_repo_url }}
|
||||
Environment=RESTIC_PASSWORD_FILE={{ restic_password_file }}
|
||||
Environment=RCLONE_CONFIG={{ rclone_config_path }}
|
||||
|
||||
# Back up the specified paths
|
||||
ExecStart=/usr/bin/restic backup {{ backup_paths | join(' ') }}
|
||||
|
||||
# Forget/Prune policy
|
||||
ExecStartPost=/usr/bin/restic forget --keep-daily {{ keep_daily }} --keep-weekly {{ keep_weekly }}
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Restic Prune: {{ backup_name }}
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
Environment=RESTIC_REPOSITORY={{ restic_repo_url }}
|
||||
Environment=RESTIC_PASSWORD_FILE={{ restic_password_file }}
|
||||
Environment=RCLONE_CONFIG={{ rclone_config_path }}
|
||||
|
||||
ExecStart=/usr/bin/restic prune
|
||||
Reference in New Issue
Block a user