DEV Community

miku86
miku86

Posted on • Originally published at miku86.com

2020-11-15 | Backup Progress

I got my new 64GB USB stick. You can read about my backup story here and here.

The script is fairly simple:

#!/bin/sh
now=$(date +%Y-%m-%d_%H-%M-%S)
user=miku86
backup_source=/home/$user
backup_dest_local=/home/$user/BACKUP/ # do not forget to exclude this
backup_dest_external=/run/media/$user/HOMEBACKUP/$now

rsync -h --progress --stats -r -tgo -p -l -D --update --delete-after --delete-excluded \
# ... many lines of exluding folders, e.g. cache, node_modules etc.
$backup_source $backup_dest_local &&
cp -r $backup_dest_local $backup_dest_external
Enter fullscreen mode Exit fullscreen mode

Every some days I move the data from the USB stick to my external long-term backup after some cleaning.

Top comments (0)