Compare commits

...

6 Commits

4
.gitignore vendored

@ -7,5 +7,5 @@ resticClean.sh
resticExcludes
rsync.sh
rsyncManifest
variables.sh
variablesAWS.sh
backupsVariables.sh
backupsVariablesAWS.sh

@ -103,25 +103,25 @@ restic backup --verbose --compression max \
10. Verify your backup by first fetching the snapshot ID:
```bash
restic -r /path/to/repo snapshots
restic snapshots -r /path/to/repo
```
Then list the files within to verify eveything is there:
```bash
restic ls -r /path/to/repo --long $SNAPSHOT_ID
restic ls --long -r /path/to/repo $SNAPSHOT_ID
```
Then compare the backup size to the size of the source. This will retrieve the uncompressed size of the repo, and it won't perfectly align. But it should give you an idea.
```bash
restic ls -r /path/to/repo stats $SNAPSHOT_ID
restic stats -r /path/to/repo
```
And finally, check the integrity of the repo:
```bash
restic -r /path/to/repo check
restic check -r /path/to/repo
```
<br>

@ -11,17 +11,17 @@ cp ./templates/resticExcludesTemplate ./resticExcludes
cp ./templates/resticTemplate.sh ./restic.sh
cp ./templates/rsyncManifestTemplate ./rsyncManifest
cp ./templates/rsyncTemplate.sh ./rsync.sh
cp ./templates/variablesAWSTemplate.sh ./variablesAWS.sh
cp ./templates/variablesTemplate.sh ./variables.sh
cp ./templates/backupsVariablesAWSTemplate.sh ./backupsVariablesAWS.sh
cp ./templates/backupsVariablesTemplate.sh ./backupsVariables.sh
# Set scripts to executable
chmod +x ./backups.sh
chmod +x ./resticClean.sh
chmod +x ./restic.sh
chmod +x ./rsync.sh
chmod +x ./variablesAWS.sh
chmod +x ./variables.sh
chmod +x ./backupsVariablesAWS.sh
chmod +x ./backupsVariables.sh
# Set variable files to r/w by owner only
chmod 600 ./variablesAWS.sh
chmod 600 ./variables.sh
chmod 600 ./backupsVariablesAWS.sh
chmod 600 ./backupsVariables.sh

@ -4,15 +4,15 @@
# SCRIPT PREP #
###############
# Source base directory of script and source variables
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. "${SCRIPT_DIR}"/backupsVariables.sh
# Update restic
if [ $UPDATE = 'yes' ]; then
restic self-update
fi
# Source base directory of script and source variables
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. "${SCRIPT_DIR}"/variables.sh
############################
# LOGGING & ERROR HANDLING #
############################
@ -65,7 +65,7 @@ fi
# Overwrite LAN restic variables with the AWS restic variables
if [ $LAN_AND_AWS_RESTIC = 'yes' ]; then
. "${SCRIPT_DIR}"/variablesAWS.sh
. "${SCRIPT_DIR}"/backupsVariablesAWS.sh
fi
# If selected, run a remote restic backup

@ -58,7 +58,7 @@ readonly LOG_RETENTION='30'
## Only uncomment and set these if RSYNC_BACKUP further above is set to 'yes'
## Set these vars
# readonly RSYNC_SOURCE='/'
# readonly RSYNC_SOURCE='/home'
# readonly RSYNC_DEST='/path/to/dir/to/backup/to'
# readonly RSYNC_RETENTION_KEEP_LAST='7'
@ -100,7 +100,7 @@ readonly LOG_RETENTION='30'
## Recommendation is to leave the first tag be, and configure the second
# readonly RESTIC_TAG_01="${HOSTNAME}"
# readonly RESTIC_TAG_02='TAG-02'
# readonly RESTIC_TAG_02='home'
## Leave this var be
# readonly RESTIC_EXCLUDES="${SCRIPT_DIR}/resticExcludes"

@ -1,3 +1,7 @@
/home/**/.cache
/home/**/.config/discord/Cache
/home**/.steam
/home/**/.steam
/home/**/Games
/home/**/.local/share/Trash
**/backupsVariables.sh
**/backupsVariablesAWS.sh

@ -1,22 +1,18 @@
#!/bin/bash
if [ AWS_RESTIC_BACKUP = 'no' ]; then
if [ $AWS_RESTIC_BACKUP = 'no' ]; then
restic backup --verbose \
--tag "${RESTIC_TAG_01}" --tag "${RESTIC_TAG_02}" \
--exclude-caches \
--exclude-file="${RESTIC_EXCLUDES}" \
--exclude "${SCRIPT_DIR}"/variables.sh \
--exclude "${SCRIPT_DIR}"/variablesAWS.sh \
"${RESTIC_SOURCE}"
fi
if [ AWS_RESTIC_BACKUP = 'yes' ]; then
if [ $AWS_RESTIC_BACKUP = 'yes' ]; then
restic backup --verbose \
--tag "${RESTIC_TAG_01}" --tag "${RESTIC_TAG_02}" \
--exclude-caches \
--exclude-file="${RESTIC_EXCLUDES}" \
--exclude "${SCRIPT_DIR}"/variables.sh \
--exclude "${SCRIPT_DIR}"/variablesAWS.sh \
-o s3.connections="${AWS_CONNECTIONS}" \
--limit-upload "${AWS_UPLOAD}" \
"${RESTIC_SOURCE}"

@ -2,10 +2,10 @@
+ */
# Second, exclude anything from within the next section that you don't want
# Then, include the dirs/paths/files you want to backup
+ /home/*/bin/***
+ /home/*/.local/bin/***
+ /home/*/*shrc
+ /home/*/*history
+ /*/bin/***
+ /*/.local/bin/***
+ /*/*shrc
+ /*/*history
+ **/docker-compose.yml
# Finally, exclude everything not explicitely included above
- *
Loading…
Cancel
Save