Skip to content
Snippets Groups Projects
Verified Commit ff91aea8 authored by David Beniamine's avatar David Beniamine
Browse files

fist commit

parents
No related branches found
No related tags found
No related merge requests found
*.env
# Simple backup
This is just a very simple script that save several directorys to a destination
via rsync, then prompt for shutdown.
This script is meant to be run by small buisness at closing time.
## Install
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`
export USER=""
export HOST=""
export DESTINATION=""
export DIRECTORIES=""
export TIMEOUT="30"
export RSYNC_PASSWORD="secret"
#!/bin/bash
. ${0/.sh/.env}
for d in ${DIRECTORIES}
do
rsync $d $USER@$HOST:/$DESTINATION/$d
done
zenity --timeout $TIMEOUT --question --title "Sauvegarde terminée." \
--text "Voulez vous procéder à l'extinction automatique de l'ordinateur ?"
ans=$?
if [ $ans == 0 ]
then
sudo shutdown -h now
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment