Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
892895e8
Commit
892895e8
authored
May 08, 2016
by
Igor Pecovnik
Browse files
Added rsyc script, working with the same file list ... dry run by default
parent
c5ca0ce5
Changes
3
Hide whitespace changes
Inline
Side-by-side
backup and restore/backup.sh
View file @
892895e8
...
...
@@ -14,13 +14,6 @@ HOST=localhost
mkdir
-p
$COPY_TO
function
crontab_backup
()
{
echo
-e
"[
\e
[0;32m o.k.
\x
1B[0m]
\e
[1;32m
$1
\x
1B[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
...
...
backup and restore/filelist.txt
View file @
892895e8
/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
\ No newline at end of file
#/etc/logrotate.d
/usr/local/ispconfig/interface/ssl
/usr/local/bin/removecomptorrent.sh
/var/spool/cron/crontabs
#/etc/crontab
/var/vmail
/var/www
\ No newline at end of file
backup and restore/sync.sh
0 → 100644
View file @
892895e8
#!/bin/bash
REMOTE
=
function
sync_backup
()
{
echo
-e
"[
\e
[0;32m o.k.
\x
1B[0m]
\e
[1;32m
$1
\x
1B[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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment