För att på ett enkelt sätt hantera rsyncd skall SElinux vara disabled.
- Konfigurera rsync
|
|
Aktivera rsyncd-deamon
| Portar i /etc/services
rsync 873/tcp # rsync
rsync 873/udp # rsync
Filer för systemctl finns /SystemQ/newconfig/rsync
rsyncd@.service
rsyncd.socket
cp /opt/SystemQ/newconfig/rsync/rsyncd@.service /usr/lib/systemd/system
cp /opt/SystemQ/newconfig/rsync/rsyncd.socket /usr/lib/systemd/system
systemctl enable rsyncd.socket
systemctl start rsyncd.socket
|
Konfigurera rsync-volymer
| vi /etc/rsyncd.conf
read only = true
#use chroot = yes
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
#hosts allow = trusted.hosts
#slp refresh = 300
use chroot = false
[SystemQ]
path = /opt/SystemQ/
read only = no
[BACKUPDATABAS]
path = /disk3/backup/databas
read only = no
hosts allow = 192.168.31.3 192.168.32.60
[DATA]
path = /disk3/backup/data/
read only = no
hosts allow = 192.168.31.3 192.168.32.60
|
Konfigurera SystemQ-uppdateringar
|
- logga in som root/su
- cd
- vi rsync.sh
LÌgg in denna text i filen:
echo "Startar Rsync: " `date` >> /tmp/rsync.log
/usr/bin/rsync -auvz 192.168.31.3::SYSTEMQ/ /opt/SystemQ/ 2>>/tmp/rsync.msg
echo "Rsync klar: " `date` >> /tmp/rsync.log
- chmod 777 rsync.sh
- testa med ./rsync.sh
Nu skall alla SystemQ-filer med tillbehör finnas på servern under /opt/SystemQ
|
Konfigurera schemalaggda processer med cron
|
- logga in som root/su
- cd
- vi cronjobb.root:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/root/cronjobb.root installed on Mon Oct 14 10:15:44 2002)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (cronjobb.root installed on Fri Dec 14 16:06:10 2001)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
#Fil: cronjobb.root
#--------------------------------------------------------------------------
# Fil som innehÔller jobb som cron skall kÎra
# Aktiveras genom att skriva crontab /opt/SystemQ/tools/cronjobb.uucp
#
# 0=SÎndag 1=MÔndag 2=Tisdag 3=Onsdag 4=Torsdag 5=Fredag 6=LÎrdag
# Min Tim MÔn-dag MÔn Veckodag Kommando
# --------------------------------------------------------------------------
0 0 * * * /sbin/shutdown -r now
0 21 * * * /root/backup.schmitz
0 8 * * 0-6 /opt/eloquence/8.0/bin/eloq -t3 Mail_demon.01 2>/tmp/Mail_demon.log
0 1 * * * /opt/SystemQ/Stada.cron
58 4 * * * /usr/sbin/ntpdate ntp.lth.se 2>var/log/ntpdate.log
* 20 * * * chmod -R 777 /opt/SystemQ/*
10 * * * * chmod -R 777 /data/systemq
2 20 * * * /root/rsync.sh
2 12 * * * /root/rsync.sh
*/3 * * * * /opt/eloquence/8.0bin/eloq -t3 Pdf_check.01 2>/tmp/Pdf_check.$$
0 7 * * 6 /root/rsync-lid.sh
0 20 * * * /opt/eloquence/8.0/bin/eloqcore Log_dataset.01 2>/tmp/Log_dataset.log
|