92 |
echo "We are in REAL mode." |
echo "We are in REAL mode." |
93 |
echo "This creates a backup file for restore" |
echo "This creates a backup file for restore" |
94 |
echo "The file includes and excludes various items" |
echo "The file includes and excludes various items" |
95 |
echo "All files, mails and MySQL DBS are not included" |
echo "All files, mails and MySQL DBS are not included, except dumps in /home/e-smith/db/mysql*/" |
96 |
|
echo "if you took the time to execute signal-event pre-backup, before" |
97 |
echo "We will create the backup file like this" |
echo "We will create the backup file like this" |
98 |
echo "tar cvzf /mnt/backup/smeserver.tgz -T dir.list --exclude-from exclude.list" |
echo "tar cvzf /mnt/backup/smeserver.tgz -T dir.list --exclude-from exclude.list" |
99 |
echo "" |
echo "" |
100 |
echo "After the script has finished all mail/file.web services will be stopped" |
echo "After the script has finished all mail/file/web services will remain stopped" |
101 |
|
echo "This is to ensure your backup is up to date untill you transfer it to new server." |
102 |
echo "Copy the backup to your new server, and manually copy over the remaining files" |
echo "Copy the backup to your new server, and manually copy over the remaining files" |
103 |
fi |
fi |
104 |
|
|
120 |
/etc/sudoers |
/etc/sudoers |
121 |
/root |
/root |
122 |
/home/e-smith/Maildir |
/home/e-smith/Maildir |
|
/home/e-smith/home |
|
123 |
/home/e-smith/ssl.crt |
/home/e-smith/ssl.crt |
124 |
/home/e-smith/ssl.key |
/home/e-smith/ssl.key |
125 |
/home/e-smith/dkim_keys |
/home/e-smith/dkim_keys |
195 |
find /usr/local/ -maxdepth 1 -type d -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
find /usr/local/ -maxdepth 1 -type d -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
196 |
# search for cron files not owned by a rpm |
# search for cron files not owned by a rpm |
197 |
find /etc/cron.* -type f -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
find /etc/cron.* -type f -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
198 |
# search for udev rules not owned by a rpm ! oucl add an option there in case you change of hardware |
# search for udev rules not owned by a rpm ! could add an option there in case you change of hardware |
199 |
find /etc/udev/rules.d/ -type f -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
# removed as migration from sme9 to sme10 will change the names, and this will make it worst |
200 |
|
#find /etc/udev/rules.d/ -type f -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
201 |
# search for spamassassin user created config |
# search for spamassassin user created config |
202 |
find /etc/mail/spamassassin -maxdepth 1 -type f -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
find /etc/mail/spamassassin -maxdepth 1 -type f -print0 | xargs -0 -I % sh -c "rpm -qf % 2>&1 > /dev/null || echo % >> dir.list" |
203 |
|
|
308 |
done |
done |
309 |
fi |
fi |
310 |
if [ -d /etc/fail2ban/jail.d ]; then |
if [ -d /etc/fail2ban/jail.d ]; then |
311 |
for F in $(/etc/fail2ban/jail.d/);do |
for F in $(ls /etc/fail2ban/jail.d/);do |
312 |
rpm -qf /etc/fail2ban/jail.d/$F >/dev/null 2>&1 || echo /etc/fail2ban/jail.d/$F >> dir.list |
rpm -qf /etc/fail2ban/jail.d/$F >/dev/null 2>&1 || echo /etc/fail2ban/jail.d/$F >> dir.list |
313 |
done |
done |
314 |
fi |
fi |
411 |
rpm -q smeserver-sme9admin >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
rpm -q smeserver-sme9admin >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
412 |
/var/lib/sme9admin/ |
/var/lib/sme9admin/ |
413 |
EOF |
EOF |
414 |
|
rpm -q smeserver-smeadmin >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
415 |
|
/var/lib/smeadmin/ |
416 |
|
EOF |
417 |
|
#softethernet |
418 |
|
rpm -q softethervpn >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
419 |
|
/usr/vpnserver/vpn_server.config |
420 |
|
/usr/vpnserver/backup.vpn_server.config |
421 |
|
/usr/vpnserver/chain_certs |
422 |
|
/usr/vpnserver/packet_log |
423 |
|
/usr/vpnserver/security_log |
424 |
|
/usr/vpnserver/server_log |
425 |
|
EOF |
426 |
#smeserver-sysmon |
#smeserver-sysmon |
427 |
rpm -q smeserver-sysmon >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
rpm -q smeserver-sysmon >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
428 |
/var/lib/rrd/ |
/var/lib/rrd/ |
450 |
rpm -q smeserver-webfilter >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
rpm -q smeserver-webfilter >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
451 |
/var/squidGuard/blacklists/ |
/var/squidGuard/blacklists/ |
452 |
EOF |
EOF |
453 |
#smeserver-webshares |
#smeserver-webshare |
454 |
rpm -q smeserver-webshares >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
rpm -q smeserver-webshare >/dev/null 2>&1 && cat <<'EOF' >>dir.list |
455 |
/opt/webshare |
/opt/webshare |
456 |
EOF |
EOF |
457 |
# smeserver-zabbix-server smeserver-zabbix-agent smeserver-zabbix-proxy |
# smeserver-zabbix-server smeserver-zabbix-agent smeserver-zabbix-proxy |
558 |
tar cvzf /mnt/backup/smeserver.tgz -T dir.list --exclude-from exclude.list --xattrs |
tar cvzf /mnt/backup/smeserver.tgz -T dir.list --exclude-from exclude.list --xattrs |
559 |
echo "Finished. Backup file is in /mnt/backup" |
echo "Finished. Backup file is in /mnt/backup" |
560 |
echo "All services stopped." |
echo "All services stopped." |
561 |
echo "Please copy the remaining files to the new server before you halt this server" |
echo "Please copy the remaining excluded files (e.g. /home/e-smith/files/*) to the new server before you halt this server" |
562 |
|
|
563 |
else |
else |
564 |
echo "Test mode enabled - no backup run" |
echo "Test mode enabled - no backup run" |