| #!/bin/sh |
| |
| |
| |
| t_Log "Running $0 - rsyncd can rsync from/to local machine." |
| |
| |
| |
| PATH2FILE='/var/tmp/rsync' |
| mkdir -p $PATH2FILE |
| FILE='rsync-test' |
| cat > $PATH2FILE/$FILE <<EOF |
| Testing rsync |
| EOF |
| |
| cat > /etc/rsyncd.conf <<EOF |
| gid = root |
| uid = root |
| read only = true |
| use chroot = true |
| log file = /var/log/rsyncd.log |
| pid file = /var/run/rsyncd.pid |
| hosts allow = 127.0.0.1 |
| [centos-test] |
| path = $PATH2FILE |
| list = yes |
| exclude = * |
| include = $FILE |
| EOF |
| |
| t_ServiceControl xinetd restart |
| |
| |
| |
| chcon -R -t public_content_t $PATH2FILE |
| |
| |
| rsync --recursive --verbose --include=$FILE --exclude=* rsync://127.0.0.1/centos-test /var/log/ |
| |
| t_CheckExitStatus $? |
| |
| |
| /bin/rm $PATH2FILE/$FILE |
| /bin/rm /etc/rsyncd.conf |
| /bin/rm /var/log/$FILE |
| |
| t_ServiceControl xinetd restart |