I would suggest that you have a look at grsync.
It is a GUI for rsync and it may make back-ups a bit easier for you.
Code:sudo apt install grsync
Printable View
Yeah. This is one of those things where it is pretty simple when someone shows you how, but can be completely baffling if you've never done these things before. I understand your difficulty.
Is there anyone you can video chat with who understands Unix scripting, just a little? 5 minutes with them explaining some basics is probably all you need.
In the meantime, https://help.ubuntu.com/community/Be...ting#Scripting may be enough to get over the hump you've hit.
The linked script must be run with 'root' elevated permissions for a number of reasons. It will not work for normal users and it will not make correct backups if run as a normal user.
The hostname is already set by the running shell.
Many people may have more that 1 computer and having their backups go to a directory for each different computer is smart. This is useful both for network backups and if the backup storage is USB plugged and unplugged into each computer as needed. I have about 20 systems here. Each gets backed up to the same "server", to the same backup partition. Because each has a different hostname, these backups never collide.
This time I didn't see any failure. The result is given below.
I have unmounted the external hard disk, as suggested. What next? I think you won't mind.Code:anupam@anupam-ubuntu:~$ sudo #!/bin/bash
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] file ...
anupam@anupam-ubuntu:~$ sudo # ##################################
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] file ...
anupam@anupam-ubuntu:~$ sudo # Simple /home/ backup script
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] file ...
anupam@anupam-ubuntu:~$ # ##################################
anupam@anupam-ubuntu:~$ sudo SOURCE="/home"
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] file ...
anupam@anupam-ubuntu:~$ TARGET=/mnt/Backups/$HOSTNAME
anupam@anupam-ubuntu:~$ HOWMANY="365D"
anupam@anupam-ubuntu:~$ sudo # mounted to /mnt/Backups/
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] file ...
anupam@anupam-ubuntu:~$ # mounted to /mnt/Backups/
anupam@anupam-ubuntu:~$ sudo /bin/mkdir -p "$TARGET"
[sudo] password for anupam:
Sorry, try again.
[sudo] password for anupam:
anupam@anupam-ubuntu:~$ sudo /usr/bin/rdiff-backup --exclude-special-files "$SOURCE" "$TARGET"
sudo: /usr/bin/rdiff-backup: command not found
anupam@anupam-ubuntu:~$ /usr/bin/rdiff-backup --exclude-special-files "$SOURCE" "$TARGET"
bash: /usr/bin/rdiff-backup: No such file or directory
anupam@anupam-ubuntu:~$ #/usr/bin/rdiff-backup --exclude-special-files "$SOURCE" "$TARGET"
anupam@anupam-ubuntu:~$
Dude, you aren't supposed to run 1 command at a time. You are supposed to put the script into a single file, then run it by using the crontab.
The first backup will take some time depending on size of data.
Subsequent backups will be much quicker because only files that have been changed will be backed up.
My daily backup of approx 10GB takes approx 60 - 90 seconds.