Changes

From Amahi Wiki
Jump to: navigation, search
1,839 bytes added ,  04:20, 14 December 2013
'''NOTE:''' See [http://wiki.znc.in/Cert ZNC Cert] for more guidance on certificates.
 
== Backup Setrtings ==
You can have your setting automatically backed up or do it manually. * Install a few dependencies:
yum install p7zip mailx
* Create <b>znc-backup.sh</b> and place it in /var/hda/web-apps/znc/html directory (ensure you change the USER as noted below):
<pre>
#!/bin/bash
### Change this:
USER=**Your HDA First Admin User**
MAILADRESSE1=root
YOUREHOST=localhost
### Facultatif change :
DIR=/home/$USER/.znc
TAR_PATH=`whereis tar | cut -d ' ' -f 2`
p7zip_PATH=`whereis 7za | cut -d ' ' -f 2`
SendEmail_PATH=`whereis mailx | cut -d ' ' -f 2`
DATEI1=$(date +%Y-%m-%d)_znc_backup.tar
DATEI2=$(date +%Y-%m-%d)_znc_backup.tar.7z
DATUM=$(date +%Y-%m-%d)
sevenzp="a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on -mhe=on -p=$PASSWORD"
### no Change after here
if [ ! -d "$DIR" ]; then echo "You MUST change DIR variable. TAR. Visit: http://wiki.znc.in/index.php?title=ZNC_Backup"; exit 0; fi
if [ ! -x "$TAR_PATH" ]; then echo "You MUST change TAR_PATH variable. Or install TAR. Visit: http://wiki.znc.in/index.php?title=ZNC_Backup"; exit 0; fi
if [ ! -x "$p7zip_PATH" ]; then echo "You MUST change p7zip_PATH variable. Or install p7zip. Visit: http://wiki.znc.in/index.php?title=ZNC_Backup"; exit 0; fi
if [ ! -x "$SendEmail_PATH" ]; then echo "You MUST change SendEmail_PATH variable. Or install SendEmail. Visit: http://wiki.znc.in/index.php?title=ZNC_Backup"; exit 0; fi
$TAR_PATH -cvf $DATEI1 $DIR
$p7zip_PATH $sevenzp $DATEI2 $DATEI1
echo ZNC Backup from $DATUM | $SendEmail_PATH -r $USER@$YOUREHOST -s ZNC-Backup-$DATUM -a $DATEI2 $MAILADRESSE1
rm -f $DATEI1 $DATEI2
</pre>
* Install a cron job as your First Admin User, not root:
crontab -e
** Insert the following text:
40 0 * * 5 /var/hda/web-apps/znc/html/znc-backup.sh >/dev/null 2>&1
** This will run on Fri at 00:40 AM, but you can change to meet your needs.
== IRC Client Setup ==
12,424

edits