Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

restic

Install

sudo apt install -y restic

Configure systemd

cat < ~/.config/systemd/user/restic-backup.service
[Unit]
Description=Restic backup service

[Service]
Type=oneshot
Environment=BACKUP_PATHS="vault.pass vault-private.pass .gtkrc-2.0 .bashrc .icons .themes .thunderbird .config .ssh/config"
Environment=BACKUP_EXCLUDES="--exclude=Code --exclude=google-chrome --exclude=VirtualBox --exclude=ImapMail"
Environment=RETENTION_HOURS=8
Environment=RETENTION_DAYS=5
Environment=RETENTION_WEEKS=0
Environment=RETENTION_MONTHS=0
Environment=RETENTION_YEARS=0
Environment=RESTIC_REPOSITORY=%h/Backup
Environment=RESTIC_PASSWORD=sup3r_s3cr3t_r3p0_p4ssw0rd
ExecStart=restic backup --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS
ExecStartPost=restic forget --tag systemd.timer --group-by "paths,tags" --prune --keep-hourly $RETENTION_HOURS --keep-daily $RETENTION_DAYS 
#--keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS
ExecStartPost=rsync -aHAXx --numeric-ids --delete --stats --info=progress2 --out-format="[%%t]:%%o:%%f:Last Modified %%M" --verbose -e "ssh -o Compression=no -x" "%h/Backup/" restic@BACKUP_SERVER_FQDN:/home/restic/HOSTNAME/
EOF
<code>

<strong>Links</strong>
https://www.geekbundle.org/backups-mit-restic/

GitLab: Backup to S3

Configure Git

# /etc/gitlab/gitlab.rb
gitlab_rails['backup_upload_connection'] = {
  'provider' => 'AWS',
  'region' => 'foo-west-1',
  'aws_access_key_id' => 'KEY123',
  'aws_secret_access_key' => 'PASS124',
  'endpoint' => 'https://s3.example.com'
}
gitlab_rails['backup_upload_remote_directory'] = 'backups'
gitlab_rails['backup_keep_time'] = 604800

gitlab-ctl reconfigure

Test

gitlab-rake gitlab:backup:create

Configure periodic backup

# crontab -e
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1

Links
https://docs.gitlab.com/ce/raketasks/backup_restore.html#uploading-backups-to-a-remote-cloud-storage

Duplicity with S3

Install

sudo apt install -y duplicity python-boto

SSH

duplicity incr --log-file /tmp/duplicity.log /etc/  scp://foo@10.0.1.123//media/etc

S3

vi ~/.boto
[Credentials]
aws_access_key_id = KEY_ID
aws_secret_access_key = SECRET_ACCESS_KEY

# create backup to s3
duplicity full --log-file /tmp/duplicity.log /etc/ s3://s3.example.com/backup/host.examp.eocm/etc/

duplicity list-current-files s3+http://bucket/folder

WebDav

export FTP_PASSWORD="pass1234"
duplicity full \
  --log-file /var/log/duplicity.log /etc \
  webdavs://'user@example.com'@b24-foo.bitrix24.de/company/personal/user/1/disk/path/backup/

Links
http://duplicity.nongnu.org/duplicity.1.html
https://www.privacy-handbuch.de/handbuch_39e1.htm
https://www.digitalocean.com/community/tutorials/how-to-use-duplicity-with-gpg-to-back-up-data-to-digitalocean-spaces

rsnapshot

apt-get install -y rsnapshot

mv /etc/rsnapshot.conf /etc/rsnapshot.conf.org

cat < /etc/rsnapshot.conf
config_version	1.2
snapshot_root	/media/backup/
logfile		/var/log/rsnapshot.log
verbose		3
loglevel	3

cmd_preexec    /bin/mount /media/backup
cmd_postexec   /bin/umount /media/backup
#backup_script      /usr/local/bin/backup_mysql.sh       localhost/mysql/

cmd_rsync	/usr/bin/rsync
rsync_long_args   --delete --numeric-ids --relative --delete-excluded --copy-links
cmd_ssh		/usr/bin/ssh
ssh_args	-F /home/foo/.ssh/config -i /home/foo/.ssh/id_rsa

interval	daily	7
interval	weekly	3
interval	monthly	1

#exclude	dev/*
exclude		lost+found/*
exclude		mnt/*
exclude		proc/*
exclude		run/*
exclude		sys/*
exclude		tmp/*

include_file	~/etc/backup-server-include.txt
exclude_file	~/etc/backup-server-exclude.txt

# backup remote server
backup	root@www.example.com:/	srv/	+rsync_long_args=--exclude=export/* --exclude=media/*/.Trash* --exclude=video/*

# backup local server
backup		/		www.example.com/	+rsync_long_args=--exclude=mnt/*  --exclude=media/* --exclude=var/lib/lxc/* --exclude=var/lib/lxcfs/*

# backup LXC containers
backup		/var/lib/lxc	    www.example.com/
EOF


# backup-server-exclude.txt 
/*
/var/*
/var/snap/*
/var/snap/lxd/*
/var/snap/lxd/common/*
/var/snap/lxd/common/lxd/*
/var/snap/lxd/common/lxd/database

# rsnapshot/backup-server-include.txt 
/etc
/var
/var/snap
/var/snap/lxd
/var/snap/lxd/common
/var/snap/lxd/common/lxd
/var/snap/lxd/common/lxd/database


rsnapshot -c /etc/rsnapshot.conf daily

Check configuration
rsnapshot configtest

Desktop starter

cat << EOF | sudo tee /usr/share/applications/rsnapshot.desktop
[Desktop Entry]
Name=Backup
Exec=rsnapshot daily
Icon=org.gnome.DejaDup
Type=Application
Terminal=true
Categories=Utility;Archiving;GNOME;GTK;X-GNOME-Utilities;
EOF

Links
https://wiki.archlinux.de/title/Rsnapshot
http://www.rsnapshot.org/howto/1.2/rsnapshot-HOWTO.en.html
http://wiki.ubuntuusers.de/rsnapshot

backup
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung