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
Every some days I move the data from the USB stick to my external long-term backup after some cleaning.
Hi! I'm Michael 👋 I'm a Mentor & Educator & Senior Web Developer - I help you to reach your (career) goals.