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
6e108495
Commit
6e108495
authored
May 08, 2016
by
Igor Pecovnik
Browse files
rework 2
parent
fe50e4b4
Changes
2
Show whitespace changes
Inline
Side-by-side
backup and restore/backup.sh
View file @
6e108495
...
...
@@ -17,7 +17,7 @@ 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
crontab
-l
>
$COPY_TO
/crontab-root.txt
&> /dev/null
}
...
...
@@ -53,7 +53,16 @@ function conf_backup ()
service cups stop
service samba stop
echo
-e
"[
\e
[0;32m o.k.
\x
1B[0m]
\e
[1;32m
$1
\x
1B[0mConf files backup"
tar
cvPfz
$COPY_TO
/
$FILEBACKUPNAME
-allfiles
.tgz
-T
filelist.txt
--exclude
=
'*.sock'
# find only existing
filename
=
filelist.txt
tmpfilename
=
/tmp/filelist.txt
touch
tmpfilename
IFS
=
$'
\n
'
for
next
in
`
cat
$filename
`
do
[[
-f
$next
||
-d
$next
]]
&&
echo
"
$next
"
>>
$tmpfilename
done
tar
cvPfz
$COPY_TO
/
$FILEBACKUPNAME
-allfiles
.tgz
-T
$tmpfilename
--exclude
=
'*.sock'
service samba start
service cups start
service tvheadend start
...
...
@@ -65,12 +74,14 @@ function conf_backup ()
function
mail_backup
()
{
if
[[
-d
/var/vmail
]]
;
then
service dovecot stop
service postfix stop
echo
-e
"[
\e
[0;32m o.k.
\x
1B[0m]
\e
[1;32m
$1
\x
1B[0mMail backup"
tar
cvPfz
$COPY_TO
/
$FILEBACKUPNAME
-mail
.tgz /var/vmail
service postfix start
service dovecot start
fi
}
...
...
backup and restore/filelist.txt
View file @
6e108495
...
...
@@ -12,7 +12,6 @@
/etc/nginx
/etc/dbconfig-common
/etc/init.d/scanbuttond
/etc/init.d/hostapd
/etc/postfix
/etc/rc.local
/etc/getmail
...
...
@@ -26,6 +25,7 @@
/etc/modules
/etc/network/interfaces
/etc/hostapd.conf
/etc/hostapd-rt.conf
/etc/usbsrvd.conf
/etc/default/stunnel4
/etc/stunnel
...
...
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