mirror of
https://github.com/JanJastrow/.dotfiles.git
synced 2024-12-22 06:51:54 +01:00
Gather proxmox files for backup
This commit is contained in:
parent
326fae5d2d
commit
b9438d411d
24
scripts/backup-proxmox-confs.sh
Executable file
24
scripts/backup-proxmox-confs.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Backup folder
|
||||
BACKUP_MAIN="$HOME/backups"
|
||||
mkdir -p $BACKUP_MAIN
|
||||
|
||||
# Copy iptables rules
|
||||
if [ -d "/etc/iptables/" ]; then
|
||||
mkdir -p $BACKUP_MAIN/iptables
|
||||
rm $BACKUP_MAIN/iptables/rules.*
|
||||
sudo cp /etc/iptables/rules.v4 $BACKUP_MAIN/iptables/
|
||||
sudo cp /etc/iptables/rules.v6 $BACKUP_MAIN/iptables/
|
||||
fi
|
||||
|
||||
# Copy LXC confs
|
||||
if [ -h "/etc/pve/lxc/" ]; then
|
||||
mkdir -p $BACKUP_MAIN/lxc
|
||||
rm $BACKUP_MAIN/lxc/*.conf
|
||||
sudo cp -R /etc/pve/lxc/* $BACKUP_MAIN/lxc/
|
||||
fi
|
||||
|
||||
# Change owner
|
||||
sudo chown -R $USER:$USER $BACKUP_MAIN
|
Loading…
Reference in New Issue
Block a user