From 855334b289258824cc90d1950a32f1b452ab0a2b Mon Sep 17 00:00:00 2001 From: Peter Kannewitz Date: Thu, 30 Mar 2023 10:11:04 +0200 Subject: [PATCH 1/3] removed borgbackup as dependency --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index dab533d..d7bab8f 100644 --- a/shell.nix +++ b/shell.nix @@ -2,7 +2,7 @@ with import {}; mkShell { name = "Dependencies for Server Backup"; - buildInputs = [borgbackup borgmatic sshfs]; + buildInputs = [borgmatic sshfs]; shellHook = '' echo "Good luck backing up!" ''; From 973b157fc8dd5d7a8131f2776a9cc24cb218b38e Mon Sep 17 00:00:00 2001 From: Peter Kannewitz Date: Thu, 30 Mar 2023 10:11:45 +0200 Subject: [PATCH 2/3] removed mountpoint note and borgbackup as dep --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 80027cc..c8ef0ce 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,10 @@ For this 'pull method' to work I needed to add the following line to the servers %sudo ALL=(ALL) NOPASSWD: /usr/lib/openssh/sftp-server ``` -*Notice:* - -The server file system will be mounted at `tmp/mnt/ag-link-server` on your local machine. Define the paths to be backed up from there on. - - ## Dependencies Backup depends on: -- `borgbackup` - `borgmatic` - `sshfs` From 8d198cf6017c1138b0156e609c37db8f6b9104b8 Mon Sep 17 00:00:00 2001 From: Peter Kannewitz Date: Thu, 30 Mar 2023 10:12:11 +0200 Subject: [PATCH 3/3] introduced variables for hostname, user and mountpoint --- ag-backup.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ag-backup.yaml b/ag-backup.yaml index b175b6c..f70ab83 100644 --- a/ag-backup.yaml +++ b/ag-backup.yaml @@ -3,9 +3,10 @@ # For example, if you have a constant named "hostname" with the value # "myhostname", then the string "{hostname}" will be replaced with # "myhostname" in the configuration file. -# constants: - # hostname: myhostname - # prefix: myprefix + constants: + hostname: ag-link.xyz + user: your-username-on-server + mountpoint: /tmp/mnt/ag-link-server # Where to look for files to backup, and where to store those backups. # See https://borgbackup.readthedocs.io/en/stable/quickstart.html and @@ -15,7 +16,7 @@ location: # List of source directories to backup. Globs and tildes are # expanded. Do not backslash spaces in path names. source_directories: - - /tmp/mnt/ag-link-server/home/docker + - {mountpoint}/home/docker # Paths to local or remote repositories (required). Tildes are # expanded. Multiple repositories are backed up to in @@ -390,7 +391,7 @@ hooks: # before creating a backup, run once per repository. before_backup: - mkdir -p /tmp/mnt/ag-link-server - - sshfs ag-link.xyz:/ /tmp/mnt/ag-link-server -o sftp_server='/usr/bin/sudo /usr/lib/openssh/sftp-server' + - sshfs {username}@{hostname}:/ /tmp/mnt/ag-link-server -o sftp_server='/usr/bin/sudo /usr/lib/openssh/sftp-server' # List of one or more shell commands or scripts to execute # before pruning, run once per repository. @@ -415,7 +416,7 @@ hooks: # List of one or more shell commands or scripts to execute # after creating a backup, run once per repository. after_backup: - - fusermount -u /tmp/mnt/ag-link-server + - fusermount -u {mountpoint} # List of one or more shell commands or scripts to execute # after compaction, run once per repository.