Commit 6e108495 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

rework 2

parent fe50e4b4
...@@ -17,7 +17,7 @@ mkdir -p $COPY_TO ...@@ -17,7 +17,7 @@ mkdir -p $COPY_TO
function crontab_backup () function crontab_backup ()
{ {
echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0mCrontab backup" echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[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 () ...@@ -53,7 +53,16 @@ function conf_backup ()
service cups stop service cups stop
service samba stop service samba stop
echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0mConf files backup" echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[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 samba start
service cups start service cups start
service tvheadend start service tvheadend start
...@@ -65,12 +74,14 @@ function conf_backup () ...@@ -65,12 +74,14 @@ function conf_backup ()
function mail_backup () function mail_backup ()
{ {
if [[ -d /var/vmail ]]; then
service dovecot stop service dovecot stop
service postfix stop service postfix stop
echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0mMail backup" echo -e "[\e[0;32m o.k. \x1B[0m] \e[1;32m$1\x1B[0mMail backup"
tar cvPfz $COPY_TO/$FILEBACKUPNAME-mail.tgz /var/vmail tar cvPfz $COPY_TO/$FILEBACKUPNAME-mail.tgz /var/vmail
service postfix start service postfix start
service dovecot start service dovecot start
fi
} }
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
/etc/nginx /etc/nginx
/etc/dbconfig-common /etc/dbconfig-common
/etc/init.d/scanbuttond /etc/init.d/scanbuttond
/etc/init.d/hostapd
/etc/postfix /etc/postfix
/etc/rc.local /etc/rc.local
/etc/getmail /etc/getmail
...@@ -26,6 +25,7 @@ ...@@ -26,6 +25,7 @@
/etc/modules /etc/modules
/etc/network/interfaces /etc/network/interfaces
/etc/hostapd.conf /etc/hostapd.conf
/etc/hostapd-rt.conf
/etc/usbsrvd.conf /etc/usbsrvd.conf
/etc/default/stunnel4 /etc/default/stunnel4
/etc/stunnel /etc/stunnel
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment