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
Show whitespace changes
Inline
Side-by-side
backup and restore/backup.sh
View file @
892895e8
...
@@ -14,13 +14,6 @@ HOST=localhost
...
@@ -14,13 +14,6 @@ HOST=localhost
mkdir
-p
$COPY_TO
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
()
function
database_backup
()
{
{
if
which mysql
>
/dev/null
;
then
if
which mysql
>
/dev/null
;
then
...
@@ -97,7 +90,6 @@ function pkglist_backup ()
...
@@ -97,7 +90,6 @@ function pkglist_backup ()
# main app
# main app
crontab_backup
database_backup
database_backup
web_backup
web_backup
conf_backup
conf_backup
...
...
backup and restore/filelist.txt
View file @
892895e8
/etc/dovecot/dovecot.conf
/etc/dovecot
/etc/dovecot/dovecot.pem
#/etc/cups
/etc/dovecot/private/dovecot.pem
#/etc/fstab
/etc/cups
#/etc/transmission-daemon/settings.json
/etc/fstab
#/etc/scanbuttond
/etc/transmission-daemon/settings.json
#/etc/apache2
/etc/scanbuttond
/etc/apache2
/etc/memcached.conf
/etc/memcached.conf
/etc/logrotate.conf
#/etc/logrotate.conf
/etc/mail
/etc/mailname
/etc/mailname
/etc/nginx
/etc/nginx
/etc/dbconfig-common
#/etc/init.d/scanbuttond
/etc/init.d/scanbuttond
/etc/postfix
/etc/postfix
/etc/rc.local
/etc/passwd
#/etc/rc.local
/etc/php5
/etc/getmail
/etc/getmail
/usr/local/bin/.sync
/etc/fail2ban
/etc/shadow
/etc/group
/etc/gshadow
#/usr/local/bin/.sync
/etc/mysql/my.cnf
/etc/mysql/my.cnf
/etc/default/stunnel4
/etc/default/stunnel4
/usr/local/vpnserver/vpn_server.config
#
/usr/local/vpnserver/vpn_server.config
/usr/bin/tv_grab_file
#
/usr/bin/tv_grab_file
/home/hts/.hts/tvheadend
#
/home/hts/.hts/tvheadend
/etc/samba/smb.conf
#
/etc/samba/smb.conf
/etc/modules
#
/etc/modules
/etc/network/interfaces
#
/etc/network/interfaces
/etc/hostapd.conf
#
/etc/hostapd.conf
/etc/hostapd-rt.conf
#
/etc/hostapd-rt.conf
/etc/usbsrvd.conf
#
/etc/usbsrvd.conf
/etc/default/stunnel4
/etc/default/stunnel4
/etc/stunnel
/etc/stunnel
/etc/logrotate.d
#/etc/logrotate.d
/usr/local/ispconfig/interface/ssl/startssl.chain.class1.server.crt
/usr/local/ispconfig/interface/ssl
/usr/local/ispconfig/interface/ssl/startssl.sub.class1.server.ca.crt
/usr/local/bin/removecomptorrent.sh
/root/removecomptorrent.sh
/var/spool/cron/crontabs
/root/.ssh
#/etc/crontab
/root/.gnupg
/var/vmail
\ No newline at end of file
/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