You are not logged in.

#1 2018-03-12 22:18:16

ab90
Member
Registered: 2017-09-06
Posts: 195

Setting up a backup-schedule with bunsenlabs

Hey-hey,

i would like to arrange automatic backups on start up every three weeks of my ~/Documents folder to the sd card plugged into my netbook.


Appreciate instructions smile

Many thanks in advance


"Be humble, be cool, dance techno-style to heavy metal music."

Offline

#2 2018-03-12 23:10:18

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,674

Re: Setting up a backup-schedule with bunsenlabs

Search the forum for rsync - I think some users have already shared some scripts that do that.

You'll just have to make some modifications to match up with your system.

Last edited by PackRat (2018-03-12 23:11:07)


You must unlearn what you have learned.
    -- yoda

Offline

#3 2018-03-13 09:28:43

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,755

Re: Setting up a backup-schedule with bunsenlabs

Right, a practical example, script like

#!/bin/bash
# backup
rsync -av --stats --progress --exclude 'z800*' --exclude 'Adobe Premiere*' --exclude '*.cfa' --exclude '*.pek' --exclude '*.qtindex' --exclude '*.hphys' --exclude '*.DS_store' /Volumes/int_raid/brontosaurusrex_small /Volumes/backup/

Started from cron

# crontab to rsync my working dir with another disk, everyday at midnight
00 00 * * * /home/b/bin/backup >/tmp/stdout.log 2>/tmp/stderr.log

^ That was actually running on my work osx for a long time, /tmp/stderr.log will be the place to check when/if things go wrong. p.s. Also keep in my mind that rsync is actually unidirectional (glorified cp basically).

Last edited by brontosaurusrex (2018-03-13 09:33:21)

Offline

#4 2018-03-13 14:33:20

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,674

Re: Setting up a backup-schedule with bunsenlabs

^ You can put all those exclude patterns into a single file and then use "--exclude-from" to read in the file:

rsync -av --exclude-from='/home/user/exclude.txt'

Makes it easier to add/remove excludes - just edit the exclude.txt.

from the rsync man page:

--exclude-from=FILE
              This option is related to the --exclude option, but it specifies
              a FILE that contains exclude patterns (one per line).  Blank
              lines in the file and lines starting with ’;’ or ’#’ are
              ignored.  If FILE is -, the list will be read from standard
              input.

You must unlearn what you have learned.
    -- yoda

Offline

#5 2018-03-13 17:12:35

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,057

Re: Setting up a backup-schedule with bunsenlabs

This is the script that I use. It works with a systemd timer. It also uses a backup-excludes file.

https://github.com/tknomanzr/scripts/tr … emd-backup

Offline

#6 2018-03-13 22:18:13

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Setting up a backup-schedule with bunsenlabs

I would never trust something as important as a backup to automation.

Offline

#7 2018-03-15 06:20:21

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Setting up a backup-schedule with bunsenlabs

afaiu, rsync does not do deduplication.
this is why i chose borg eventually.

Offline

#8 2018-03-15 07:58:02

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Setting up a backup-schedule with bunsenlabs

ohnonot wrote:

rsync does not do deduplication

Perhaps I am misunderstanding what you mean by "deduplication" but rsync only copies over the differences between the last backup and the current system.

There is also tarsnap, it's a paid service but quite good value:

https://www.tarsnap.com/

Offline

#9 2018-03-17 06:29:55

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Setting up a backup-schedule with bunsenlabs

Head_on_a_Stick wrote:

Perhaps I am misunderstanding what you mean by "deduplication" but rsync only copies over the differences between the last backup and the current system.

my bad; that would be the definition of deduplication. [ that
wikipedia article mentions data compression as a defining aspect of deduplication, but i believe that to be wrong. of course it could be argued that deduplication is a form of compression. ]

Offline

#10 2018-03-17 10:15:21

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Setting up a backup-schedule with bunsenlabs

I read about recommendations regarding rsnapshot, but cannot comment on it as never tested it.

Offline

Board footer

Powered by FluxBB