Sorry, this entry is only available in Deutsch.
Monthly Archives: F Y
(Deutsch) APT-caching
Sorry, this entry is only available in Deutsch.
(Deutsch) Electric Sheep
Sorry, this entry is only available in Deutsch.
Systembackup using rsync
Why does nobody a backup if everybody is talking about it? Using a unix-system with rsync it is that easy!:
First you should know some things about rsync: its an network protocol for synchronizing files. The interesting thing about rsync is that it is able to compare parts of a file and if it is needed sync only that parts. For example if there was changed one line of a config-file it will only transfer the information of that line through the network. Thats why rsync is really lightweight and fast. I am backing up my Linux-systems using rsync. I want to show how i created a backup script and how it is working.
- -a is short for following commands:
-rcopies the subfolders too-lcopies symbolic links-ppreserve permissions of the source file-tpreserve timestamps of the source file-gpreserve group permissions of the source file-opreserve user rights of the source file (root only)-Dpreserve device files (nur root)
- -z Use compression (if you are storing your backup to a network attached storage)
- -c skip based on checksum, not mod-time & size (take more time but is saver)
- ‘-e ssh’ defines the remote shell
- –delete delete extraneous files from dest dirs
- –stats Exports some stats
- ‘–exclude=foobar’ excludes the mask ‘foobar’
In the target path there is “$(hostname)” included. That is needed if you want to back up more then on system in the same path because it creates a folder named by the hostname. (for example “claw-desktop”)
Logs are exported to /var/log/ with the date year-month-day: “backup$(date +%Y%m%d)”
I am running this script as cronjob (crontab) as root and for target i use a samba mountpoint.
If you have any question or suggestions feel free to contact me.