/[smecontribs]/rpms/smeserver-migratehelper/contribs10/migratehelper.sh
ViewVC logotype

Diff of /rpms/smeserver-migratehelper/contribs10/migratehelper.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.8 by jcrisp, Sun Nov 14 13:58:14 2021 UTC Revision 1.14 by jpp, Tue Mar 7 05:16:08 2023 UTC
# Line 92  else Line 92  else
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    
# Line 118  cat <<'EOF' >dir.list Line 120  cat <<'EOF' >dir.list
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
# Line 194  find /usr/local/bin/ -type f -print0 | x Line 195  find /usr/local/bin/ -type f -print0 | x
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    
# Line 306  if [ -d /etc/fail2ban/filter.d ]; then Line 308  if [ -d /etc/fail2ban/filter.d ]; then
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
# Line 409  EOF Line 411  EOF
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/
# Line 436  EOF Line 450  EOF
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
# Line 544  if [ $TEST = "n" ]; then Line 558  if [ $TEST = "n" ]; then
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"


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed