Skip to content

Commit

Permalink
[Config] Configure and startup rsync daemon for MultiSync file sync
Browse files Browse the repository at this point in the history
  • Loading branch information
cpinkham committed Aug 5, 2015
1 parent 9c3e1a7 commit 747b503
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
42 changes: 42 additions & 0 deletions etc/rsync
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# defaults file for rsync daemon mode

# start rsync in daemon mode from init.d script?
# only allowed values are "true", "false", and "inetd"
# Use "inetd" if you want to start the rsyncd from inetd,
# all this does is prevent the init.d script from printing a message
# about not starting rsyncd (you still need to modify inetd's config yourself).
RSYNC_ENABLE=true

# which file should be used as the configuration file for rsync.
# This file is used instead of the default /etc/rsyncd.conf
# Warning: This option has no effect if the daemon is accessed
# using a remote shell. When using a different file for
# rsync you might want to symlink /etc/rsyncd.conf to
# that file.
# RSYNC_CONFIG_FILE=

# what extra options to give rsync --daemon?
# that excludes the --daemon; that's always done in the init.d script
# Possibilities are:
# --address=123.45.67.89 (bind to a specific IP address)
# --port=8730 (bind to specified port; default 873)
RSYNC_OPTS=''

# run rsyncd at a nice level?
# the rsync daemon can impact performance due to much I/O and CPU usage,
# so you may want to run it at a nicer priority than the default priority.
# Allowed values are 0 - 19 inclusive; 10 is a reasonable value.
RSYNC_NICE=''

# run rsyncd with ionice?
# "ionice" does for IO load what "nice" does for CPU load.
# As rsync is often used for backups which aren't all that time-critical,
# reducing the rsync IO priority will benefit the rest of the system.
# See the manpage for ionice for allowed options.
# -c3 is recommended, this will run rsync IO at "idle" priority. Uncomment
# the next line to activate this.
# RSYNC_IONICE='-c3'
RSYNC_IONICE='-c3'

# Don't forget to create an appropriate config file,
# else the daemon will not start.
12 changes: 12 additions & 0 deletions etc/rsyncd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
max connections = 2
log file = FPPHOME/media/logs/rsync.log
timeout = 300

[media]
path = FPPHOME/media
read only = no
list = no
uid = pi
gid = pi
hosts allow = 127.0.0.0/8 192.168.0.0/16 10.0.0.0/16

5 changes: 5 additions & 0 deletions scripts/startup
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ do
fi
done

echo "FPP - Copying rsync daemon config files into place and restarting"
sed -e "s#FPPDIR#${FPPDIR}#g" -e "s#FPPHOME#${FPPHOME}#g" < ${FPPDIR}/etc/rsync > /etc/default/rsync
sed -e "s#FPPDIR#${FPPDIR}#g" -e "s#FPPHOME#${FPPHOME}#g" < ${FPPDIR}/etc/rsync.conf > /etc/rsync.conf
/etc/init.d/rsync restart

echo "FPP - Copying Apache config into place and restarting Apache"
sed -e "s#FPPDIR#${FPPDIR}#g" -e "s#FPPHOME#${FPPHOME}#g" < ${FPPDIR}/etc/apache2.site > ${SITEFILE}
/etc/init.d/apache2 restart
Expand Down

0 comments on commit 747b503

Please sign in to comment.