mirror of
https://github.com/armbian/config.git
synced 2026-01-06 09:53:35 -08:00
Added rsyc script, working with the same file list ... dry run by default
This commit is contained in:
@@ -14,13 +14,6 @@ HOST=localhost
|
||||
mkdir -p $COPY_TO
|
||||
|
||||
|
||||
function crontab_backup ()
|
||||
{
|
||||
echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0mCrontab backup"
|
||||
crontab -l > $COPY_TO/crontab-root.txt &> /dev/null
|
||||
}
|
||||
|
||||
|
||||
function database_backup ()
|
||||
{
|
||||
if which mysql >/dev/null; then
|
||||
@@ -97,7 +90,6 @@ function pkglist_backup ()
|
||||
|
||||
|
||||
# main app
|
||||
crontab_backup
|
||||
database_backup
|
||||
web_backup
|
||||
conf_backup
|
||||
|
||||
@@ -1,37 +1,42 @@
|
||||
/etc/dovecot/dovecot.conf
|
||||
/etc/dovecot/dovecot.pem
|
||||
/etc/dovecot/private/dovecot.pem
|
||||
/etc/cups
|
||||
/etc/fstab
|
||||
/etc/transmission-daemon/settings.json
|
||||
/etc/scanbuttond
|
||||
/etc/apache2
|
||||
/etc/dovecot
|
||||
#/etc/cups
|
||||
#/etc/fstab
|
||||
#/etc/transmission-daemon/settings.json
|
||||
#/etc/scanbuttond
|
||||
#/etc/apache2
|
||||
/etc/memcached.conf
|
||||
/etc/logrotate.conf
|
||||
#/etc/logrotate.conf
|
||||
/etc/mail
|
||||
/etc/mailname
|
||||
/etc/nginx
|
||||
/etc/dbconfig-common
|
||||
/etc/init.d/scanbuttond
|
||||
#/etc/init.d/scanbuttond
|
||||
/etc/postfix
|
||||
/etc/rc.local
|
||||
/etc/passwd
|
||||
#/etc/rc.local
|
||||
/etc/php5
|
||||
/etc/getmail
|
||||
/usr/local/bin/.sync
|
||||
/etc/fail2ban
|
||||
/etc/shadow
|
||||
/etc/group
|
||||
/etc/gshadow
|
||||
#/usr/local/bin/.sync
|
||||
/etc/mysql/my.cnf
|
||||
/etc/default/stunnel4
|
||||
/usr/local/vpnserver/vpn_server.config
|
||||
/usr/bin/tv_grab_file
|
||||
/home/hts/.hts/tvheadend
|
||||
/etc/samba/smb.conf
|
||||
/etc/modules
|
||||
/etc/network/interfaces
|
||||
/etc/hostapd.conf
|
||||
/etc/hostapd-rt.conf
|
||||
/etc/usbsrvd.conf
|
||||
#/usr/local/vpnserver/vpn_server.config
|
||||
#/usr/bin/tv_grab_file
|
||||
#/home/hts/.hts/tvheadend
|
||||
#/etc/samba/smb.conf
|
||||
#/etc/modules
|
||||
#/etc/network/interfaces
|
||||
#/etc/hostapd.conf
|
||||
#/etc/hostapd-rt.conf
|
||||
#/etc/usbsrvd.conf
|
||||
/etc/default/stunnel4
|
||||
/etc/stunnel
|
||||
/etc/logrotate.d
|
||||
/usr/local/ispconfig/interface/ssl/startssl.chain.class1.server.crt
|
||||
/usr/local/ispconfig/interface/ssl/startssl.sub.class1.server.ca.crt
|
||||
/root/removecomptorrent.sh
|
||||
/root/.ssh
|
||||
/root/.gnupg
|
||||
#/etc/logrotate.d
|
||||
/usr/local/ispconfig/interface/ssl
|
||||
/usr/local/bin/removecomptorrent.sh
|
||||
/var/spool/cron/crontabs
|
||||
#/etc/crontab
|
||||
/var/vmail
|
||||
/var/www
|
||||
23
backup and restore/sync.sh
Normal file
23
backup and restore/sync.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
REMOTE=
|
||||
|
||||
function sync_backup ()
|
||||
{
|
||||
echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0mSync over trusted ssh net"
|
||||
|
||||
filename=filelist.txt
|
||||
IFS=$'\n'
|
||||
for next in `cat $filename`
|
||||
do
|
||||
if [[ $next != \#* ]]; then
|
||||
echo $next
|
||||
rsync --dry-run -az --progress $REMOTE:$next $next
|
||||
[[ ! $? -eq 0 ]] && read
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
sync_backup
|
||||
|
||||
Reference in New Issue
Block a user