Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
45574a73
Commit
45574a73
authored
Aug 14, 2008
by
Matt McCutchen
Committed by
Wayne Davison
Sep 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add instant-rsyncd to support/ .
parent
26e21efc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
107 additions
and
0 deletions
+107
-0
instant-rsyncd
support/instant-rsyncd
+107
-0
No files found.
support/instant-rsyncd
0 → 100755
View file @
45574a73
#!/bin/bash
# instant-rsyncd lets you quickly set up and start a simple, unprivileged rsync
# daemon with a single module in the current directory. I've found it
# invaluable for quick testing, and I use it when writing a list of commands
# that people can paste into a terminal to reproduce a daemon-related bug.
# Sysadmins deploying an rsync daemon for the first time may find it helpful as
# a starting point.
#
# Usage: instant-rsyncd MODULE PORT RSYNCD-USERNAME [RSYNC-PATH]
# The script asks for the rsyncd user's password twice on stdin, once to set it
# and once to log in to test the daemon.
# -- Matt McCutchen <matt@mattmccutchen.net>
set
-e
dir
=
"
$(
pwd
)
"
if
[
"$#"
-lt
3
]
;
then
echo
"I would install an rsync daemon in
$dir
if you gave me"
echo
"a module name, a port, and an rsync username."
exit
1
fi
module
=
"
$1
"
port
=
"
$2
"
user
=
"
$3
"
rsync
=
"
$4
"
if
[
!
"
$rsync
"
]
;
then
rsync
=
rsync
fi
moduledir
=
"
${
dir
%/
}
/
$module
"
echo
echo
"I'm about to install an rsync daemon in
$dir
."
echo
"It will listen on port
$port
for requests giving rsync username
$user
"
echo
"and the password you are about to specify. It will serve a module"
echo
"
$module
corresponding to
$moduledir
."
echo
IFS
=
''
read
-s
-p
'Desired password: '
password
mkdir
"
$module
"
cat
>
rsyncd.conf
<<
EOF
log file = rsyncd.log
pid file = rsyncd.pid
port =
$port
use chroot = no
[
$module
]
path =
$module
read only = false
auth users =
$user
secrets file =
$module
.secrets
EOF
touch
"
$module
"
.secrets
chmod
go-rwx
"
$module
"
.secrets
cat
>
"
$module
"
.secrets
<<
EOF
$user
:
$password
EOF
cat
>
start
<<
EOF
#!/bin/bash
set -e
cd \`dirname \
$0
\`
! [ -e rsyncd.pid ] || {
echo "Is the daemon already running? If not, delete rsyncd.pid."
exit 1
}
$rsync
--daemon --config=rsyncd.conf
EOF
chmod
+x start
cat
>
stop <<
"EOF"
#!/bin/bash
set
-e
cd
`
dirname
$0
`
!
[
-e
rsyncd.pid
]
||
kill
-s
SIGTERM
$(
< rsyncd.pid
)
EOF
chmod
+x stop
path
=
"rsync://
$user
@
$(
hostname
)
:
$port
/
$module
/"
if
./start
;
then
sleep
.2
echo
echo
"I tried to start the daemon. The log file rsyncd.log says:"
echo
cat
rsyncd.log
echo
echo
"You can start and stop it with ./start and ./stop respectively."
echo
"You can customize the configuration file rsyncd.conf."
echo
echo
"Give rsync the following path to access the module:"
echo
"
$path
"
echo
echo
"Let's test the daemon now. Enter the password you chose."
echo
'$'
$rsync
--list-only
"
$path
"
$rsync
--list-only
"
$path
"
echo
echo
"You should see an empty folder; it's
$moduledir
."
else
echo
"Something went wrong. Do you see an error message?"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment