forked from lab-cat/server-backup-config
Compare commits
No commits in common. "8d198cf6017c1138b0156e609c37db8f6b9104b8" and "c14f0538f35311110d3029420086c9b021fd30bd" have entirely different histories.
8d198cf601
...
c14f0538f3
3 changed files with 13 additions and 8 deletions
|
@ -16,10 +16,16 @@ 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`
|
||||
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
# 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: ag-link.xyz
|
||||
user: your-username-on-server
|
||||
mountpoint: /tmp/mnt/ag-link-server
|
||||
# constants:
|
||||
# hostname: myhostname
|
||||
# prefix: myprefix
|
||||
|
||||
# Where to look for files to backup, and where to store those backups.
|
||||
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
|
||||
|
@ -16,7 +15,7 @@ location:
|
|||
# List of source directories to backup. Globs and tildes are
|
||||
# expanded. Do not backslash spaces in path names.
|
||||
source_directories:
|
||||
- {mountpoint}/home/docker
|
||||
- /tmp/mnt/ag-link-server/home/docker
|
||||
|
||||
# Paths to local or remote repositories (required). Tildes are
|
||||
# expanded. Multiple repositories are backed up to in
|
||||
|
@ -391,7 +390,7 @@ hooks:
|
|||
# before creating a backup, run once per repository.
|
||||
before_backup:
|
||||
- mkdir -p /tmp/mnt/ag-link-server
|
||||
- sshfs {username}@{hostname}:/ /tmp/mnt/ag-link-server -o sftp_server='/usr/bin/sudo /usr/lib/openssh/sftp-server'
|
||||
- sshfs ag-link.xyz:/ /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.
|
||||
|
@ -416,7 +415,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 {mountpoint}
|
||||
- fusermount -u /tmp/mnt/ag-link-server
|
||||
|
||||
# List of one or more shell commands or scripts to execute
|
||||
# after compaction, run once per repository.
|
||||
|
|
|
@ -2,7 +2,7 @@ with import <nixpkgs> {};
|
|||
|
||||
mkShell {
|
||||
name = "Dependencies for Server Backup";
|
||||
buildInputs = [borgmatic sshfs];
|
||||
buildInputs = [borgbackup borgmatic sshfs];
|
||||
shellHook = ''
|
||||
echo "Good luck backing up!"
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue