diff --git a/Readme.md b/Readme.md index a33ca406c7cbbc89bdd7217050a0482ceaa7f79f..128e05e75da348c3e587383be746901f7f546b4b 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,10 @@ This script is meant to be run by small buisness at closing time. ## Install +0. Clone this repo `git clone https://gitlab.tetras-libre.fr/tetras-libre/simple_backup.sh`, if required, install git before `sudo apt-get install git` 1. Install dependencies : `apt-get install zenity rsync` -2. Copy `simple_backup.env.sample` to `simple_backup.env` and edit it to your needs -3. Add a crontab entry like `0 19 * * 1-5 /path/to/simple_backup.sh` +2. Copy `simple_backup.env.sample` to `simple_backup.env` and set directories and destination +3. Add fstab entry to mount destination for instance for a NFS, add the following line to `/etc/fstab` : `//<serverip>/<directory> /media/user/backup cifs user,username=<user>,password=<password> 0 0 `, adapt every field between `<>` to your needs. +3. Add a crontab entry with command `crontab -e` like `30 18 * * * /path/to/simple_backup.sh` +4. Allow user to shutdown : `sudo visudo` and add : `user ALL=(root) NOPASSWD: /sbin/shutdown` at the end of the file, replacing 'user' by the username of the connected user. diff --git a/simple_backup.env.sample b/simple_backup.env.sample index 37e60d6a35e18109092a4d47dfad3d09ef848795..aede4ef3dbd443df623df260602dd1274e4ec307 100644 --- a/simple_backup.env.sample +++ b/simple_backup.env.sample @@ -1,3 +1,3 @@ -export DIRECTORIES="" -export DESTINATION="" +export DIRECTORIES="/home/documents /home/bureau" +export DESTINATION="/media/user/backup/user" export TIMEOUT="30"