Move /sbin to /bin
As more users would have /bin than /sbin in their PATH
This commit is contained in:
@@ -58,7 +58,7 @@ Depending on your system, the setup will look different. Choose one of
|
||||
$ sudo make install-systemd
|
||||
```
|
||||
☝ **Note**: `sudo` is required here, as some files are installed into system directories (`/etc/`
|
||||
and `/usr/sbin`). Have a look to the `Makefile` to know more.
|
||||
and `/usr/bin`). Have a look to the `Makefile` to know more.
|
||||
1. Fill out configuration values (edit with sudo):
|
||||
* `/etc/restic/pw.txt` - Contains the password (single line) to be used by restic to encrypt the repository files. Should be different than your B2 password!
|
||||
* `/etc/restic/_global.env` - Global environment variables.
|
||||
@@ -105,9 +105,9 @@ $ git clone https://github.com/erikw/restic-systemd-automatic-backup.git && cd $
|
||||
$ sudo make install-systemd
|
||||
````
|
||||
|
||||
If you want to install everything manually, we will install files to `/etc`, `/sbin`, and not use the `$make install-systemd` command, then you need to clean up a placeholder `$INSTALL_PREFIX` in the souce files first by running:
|
||||
If you want to install everything manually, we will install files to `/etc`, `/bin`, and not use the `$make install-systemd` command, then you need to clean up a placeholder `$INSTALL_PREFIX` in the souce files first by running:
|
||||
```console
|
||||
$ find etc sbin -type f -exec sed -i.bak -e 's|$INSTALL_PREFIX||g' {} \; -exec rm {}.bak \;
|
||||
$ find etc bin -type f -exec sed -i.bak -e 's|$INSTALL_PREFIX||g' {} \; -exec rm {}.bak \;
|
||||
```
|
||||
and you should now see that all files have been changed like e.g.
|
||||
```diff
|
||||
@@ -152,7 +152,7 @@ $ restic init
|
||||
```
|
||||
|
||||
#### 4. Script for doing the backup
|
||||
Put this file in `/sbin`:
|
||||
Put this file in `/bin`:
|
||||
* `restic_backup.sh`: A script that defines how to run the backup. The intention is that you should not need to edit this script yourself, but be able to control everything from the `*.env` profiles.
|
||||
|
||||
Restic support exclude files. They list file pattern paths to exclude from you backups, files that just occupy storage space, backup-time, network and money. `restic_backup.sh` allows for a few different exclude files.
|
||||
@@ -165,7 +165,7 @@ Now see if the backup itself works, by running as root
|
||||
```console
|
||||
$ sudo -i
|
||||
$ source /etc/restic/default.env
|
||||
$ /sbin/restic_backup.sh
|
||||
$ /bin/restic_backup.sh
|
||||
````
|
||||
|
||||
#### 6. Verify the backup
|
||||
@@ -229,7 +229,7 @@ $ journalctl -f -u restic-backup@default.service
|
||||
#### 8. Email notification on failure
|
||||
We want to be aware when the automatic backup fails, so we can fix it. Since my laptop does not run a mail server, I went for a solution to set up my laptop to be able to send emails with [postfix via my Gmail](https://easyengine.io/tutorials/linux/ubuntu-postfix-gmail-smtp/). Follow the instructions over there.
|
||||
|
||||
Put this file in `/sbin`:
|
||||
Put this file in `/bin`:
|
||||
* `systemd-email`: Sends email using sendmail(1). This script also features time-out for not spamming Gmail servers and getting my account blocked.
|
||||
|
||||
Put this files in `/etc/systemd/system/`:
|
||||
@@ -241,7 +241,7 @@ As you maybe noticed already before, `restic-backup.service` is configured to st
|
||||
#### 9. Optional: automated backup checks
|
||||
Once in a while it can be good to do a health check of the remote repository, to make sure it's not getting corrupt. This can be done with `$ restic check`.
|
||||
|
||||
There is companion scripts, service and timer (`*check*`) to restic-backup.sh that checks the restic backup for errors; look in the repo in `usr/lib/systemd/system/` and `sbin/` and copy what you need over to their corresponding locations.
|
||||
There is companion scripts, service and timer (`*check*`) to restic-backup.sh that checks the restic backup for errors; look in the repo in `usr/lib/systemd/system/` and `bin/` and copy what you need over to their corresponding locations.
|
||||
|
||||
```console
|
||||
$ sudo -i
|
||||
@@ -272,7 +272,7 @@ If you want to run an all-classic cron job instead, do like this:
|
||||
1. Follow the main setup from [Step-by-step and manual setup](#step-by-step-and-manual-setup) but skip the systemd parts.
|
||||
1. `etc/cron.d/restic`: Depending on your system's cron, put this in `/etc/cron.d/` or similar, or copy the contents to $(sudo crontab -e). The format of this file is tested under FreeBSD, and might need adaptions depending on your cron.
|
||||
* You can use `$ make install-cron` to copy it over to `/etc/cron.d`.
|
||||
1. (Optional) `sbin/cron_mail`: A wrapper for running cron jobs, that sends output of the job as an email using the mail(1) command.
|
||||
1. (Optional) `bin/cron_mail`: A wrapper for running cron jobs, that sends output of the job as an email using the mail(1) command.
|
||||
|
||||
|
||||
# Uninstall
|
||||
@@ -294,7 +294,7 @@ A list of variations of this setup:
|
||||
* **Updating the `resticw` parser:** If you ever update the usage `DOC`, you will need to refresh the auto-generated parser:
|
||||
```console
|
||||
$ pip install doctopt.sh
|
||||
$ doctopt.sh usr/local/sbin/resticw
|
||||
$ doctopt.sh usr/local/bin/resticw
|
||||
```
|
||||
|
||||
# Releasing
|
||||
|
||||
Reference in New Issue
Block a user