FTPSYNC.CONF(5)
π FTPSYNC.CONF π (section 5 of the manual, bestie)
okay so welcome to ftpsync.conf(5) β yes it's a manual page, section 5 (that's the "file formats and conventions" girlies), and it's literally just the config file for ftpsync. Sit down, grab a snack π, we're doing this.
πΈ NAME πΈ
ftpsync.conf β the config for ftpsync. that's it. that's the name. iconic brevity. π
π¦ DESCRIPTION π¦
so ftpsync is part of the whole ftpsync suite, and its whole job is mirroring Debian and Debian-like repositories of packages. π
here's the β¨loreβ¨: there are WAY too many Debian mirrors to have the machine that generates the archive (they call it "ftp-master") populate every single one of them. so instead, mirrors are organized into a tree-shaped hierarchy. that means:
- every mirror has exactly one upstream it syncs from
- each mirror can have any number of downstreams which then sync from it
it's giving family tree but make it packages. π³ no cap.
β¨ OPTIONS β¨
π the main character options
MIRRORNAMEβ the mirrorname. this is what gets used for stuff like the trace file name, and it should always be the full hostname of the mirror. Default:$(hostname -f)TOβ destination of the mirrored files. should be an empty directory.
β οΈ CAREFUL!! this directory will contain the mirror. everything else that might have happened to be hanging out in there WILL BE GONE after the mirror sync. like, gone gone. bestie, please check before you run this. π
Default: /srv/mirrors/debian/
MAILTOβ the script can send logs (or error messages) to a mail address. if this is unset, it defaults to the current user. Default:$LOGNAMEHUBβ do we have leaf mirrors to signal that we're done and they should sync? if so, set it totrueand make sure you configurerunmirrors.mirrorsandrunmirrors.conffor your needs. Default:false
π Connection options π
RSYNC_HOSTβ the host we mirror from.RSYNC_PATHβ the upstream name of the rsync share. you can find out what share names your upstream mirror supports by running:
rsync YOURUPSTREAMSERVER::
(you might have to export RSYNC_USER/RSYNC_PASSWORD for this to work π) Default: debian
RSYNC_USERβ in case we need a user to access the rsync share at our upstream host.RSYNC_PASSWORDβ if we need a user, we also need a password. duh. πRSYNC_TRANSPORTβ set this to pick the transport used for rsync.sshβ use rsync daemon over SSH. this requires arsyncd.confon the server. additional options for the ssh client should be configured inssh_config.sslβ use rsync daemon over SSL. this requires a SSL wrapper (e.g.stunnel) for the rsync daemon on the server. see the otherRSYNC_SSLoptions below. π«Ά
RSYNC_SSL_PORTβ Default:1873RSYNC_SSL_CAPATHβ Default:/etc/ssl/certsRSYNC_SSL_METHODβftpsynccan use eitherstunnel,stunnel-old, orsocatto set up the encrypted tunnel.stunnelβ requires at least stunnel version 5.15 built against openssl 1.0.2 or later, such that the stunnel build supports thecheckHostservice-level option. this will cause stunnel to verify both the peer certificate's validity and that it's actually for the host we wish to connect to. thorough queen. πstunnel-oldβ will skip thecheckHostcheck. as such it will connect to any peer that is able to present a valid certificate, regardless of which name it is made out to. (so likeβ¦ it trusts everybody. do with that what you will π)socatβ will verify the peer certificate name only starting with version 1.7.3 (Debian 9.0).
to test if things work, you can run:
rsync -e `bin/rsync-ssl-tunnel -m socat -p 1873 -C
/etc/ssl/certs' SERVER::
Default: stunnel
RSYNC_PROXYβ you may establish the connection via a web proxy by setting the environment variableRSYNC_PROXYto ahostname:portpair pointing to your web proxy. note that your web proxy's configuration must support proxy connections to port873.
π Mirror information options π
these options add informations about the mirror to a publicly accessible file. yes, publicly. so don't be weird about it. β¨
INFO_MAINTAINERβ groups and people responsible for this mirror. these contacts are used to report irregularities and problems with the mirror. they must actually accept mail. Example:
INFO_MAINTAINER=βAdmins <admins@example.com>, Person <person@example.com>β
INFO_SPONSORβ organizations sponsoring this mirror. Example:
INFO_SPONSOR=βExample <https://example.com>β
INFO_COUNTRYβ the ISO 3361-1 code of the country hosting this mirror. Example:
INFO_COUNTRY=DE
INFO_LOCATIONβ the location this mirror is hosted in. Example:
INFO_LOCATION=βExampleβ
INFO_THROUGHPUTβ available throughput for this mirror per second. Example:
INFO_THROUGHPUT=10Gb
π§Ί Include and exclude options π§Ί
these options can be used to include or exclude specified architectures or other files from the mirror.
π¨ Notice: the source architecture needs to be included on an official/public mirror! no exceptions, bestie.
ARCH_INCLUDEβ if you want to include only a subset of architectures, this is for you. use as space seperated list of architectures in the archive you are mirroring from,sourcecounts as architecture. architectureallwill be included automatically if one binary architecture is included. Mutually exclusive withARCH_EXCLUDE. Example:
ARCH_INCLUDE=βamd64 i386 sourceβ
ARCH_EXCLUDEβ if you want to exclude an architecture, this is for you. use as space seperated list of architectures in the archive you are mirroring from,sourcecounts as architecture. Mutually exclusive withARCH_INCLUDE. Example:
ARCH_EXCLUDE=βalpha arm arm64 armel mipsel mips s390
sparcβ
EXCLUDEβ if you do want to exclude files from the mirror run, putβexcludestatements here. seersync(1)for the exact syntax, these are passed to rsync as written here.
π DO NOT TRY TO EXCLUDE ARCHITECTURES OR SUITES WITH THIS, IT WILL NOT WORK! like it will simply not do the thing. use the ARCH options above. fr fr.
π Log option π
LOGDIRβ in which directory should logfiles end up. Default:~/.local/log/ftpsyncin the package,${BASEDIR}/logotherwiseLOGβ name of our own logfile. note that${NAME}is set by theftpsyncscript depending on the way it is called. seeREADMEfor a description of the multi-archive capability and better always include${NAME}in this path. Default:LOGDIR/{NAME}.logERRORSONLYβ if you do want a mail about every single sync, set this tofalse. everything else will only send mails if a mirror sync fails. Default:trueFULLLOGSβ if you want the logs to also include output of rsync, set this totrue. careful, the logs can get pretty big, especially if it is the first mirror run. π«£ Default:falseLOGROTATEβ we do create three logfiles for every run. to save space we rotate them, this defines how many we keep. Default:14
π Other options π
LOCKTIMEOUTβ timeout for the lockfile, in case we have bash older than v4 (and no/proc). Default:3600UIPSLEEPβ number of seconds to sleep before retrying to sync whenever upstream is found to be updating while our update is running. Default:1200UIPRETRIESβ number of times the update operation will be retried when upstream is found to be updating while our update is running. note that these are retries, so: 1st attempt + retries = total attempts. Default:3TRACEHOSTβ the local hostname to be written to the trace file. Default:$(hostname -f)RSYNCβ the rsync program. (that's the whole description. she's lowkey mysterious. π )RSYNC_EXTRAβ extra rsync options as defined by the local admin. there is no default by ftpsync. please note that these options are added to EVERY rsync call. also note that these are added at the beginning of the rsync call, as the very first set of options. please ensure you do not add a conflict with the usual rsync options as shown below. β οΈRSYNC_BWβ limit I/O bandwidth. value is KBytes per second, unset or0means unlimited.RSYNC_OPTIONSβ default rsync options every rsync invocation sees.
π₯ BE VERY CAREFUL WHEN YOU CHANGE THIS OPTION, BETTER DON'T!
Default: see ftpsync script
RSYNC_OPTIONS1β options the first pass gets. we do not want thePackages/Sourceindices here, and we also do not want to delete any files yet.
π₯ BE VERY CAREFUL WHEN YOU CHANGE THIS OPTION, BETTER DON'T!
Default: see ftpsync script
RSYNC_OPTIONS2β options the second pass gets. now we do want thePackages/Sourceindices too and we also want to delete files. we also want to delete files that are excluded.
π₯ BE VERY CAREFUL WHEN YOU CHANGE THIS OPTION, BETTER DON'T!
Default: see ftpsync script
CALLBACKUSER,CALLBACKHOST,CALLBACKKEYβ the following three options are used in case we want to "callback" the host we got pushed from. π
πͺ Hooks πͺ
hook scripts can be run at various places during the sync. little pit stops, if you will. π¦
HOOK1β after lock is acquired, before first rsync.HOOK2β after first rsync, if successful.HOOK3β after second rsync, if successful.HOOK4β right before leaf mirror triggering.
note that Hook3 and Hook4 are likely to be called directly after each other. the difference is: Hook3 is called every time the second rsync was successful, but even if the mirroring needs to re-run thanks to a second push. Hook4 is only effective if we are done with mirroring. β¨
HOOK5β after leaf mirror trigger, only if we have slave mirrors (HUB=true).
π SEE ALSO π
π AUTHORS π
Debian mirror team. (absolute legends, we stan π«Ά)
and that's the whole page, bestie!! this one came from the ftpsync Manual (that's the source/version tag at the bottom, section FTPSYNC.CONF(5), you'll see it printed down there) π
β¨ go forth and mirror responsibly, and remember: don't touch RSYNC_OPTIONS. like, at all. ily, bye!! ππ
π¦ where this page comes from
- debian bookworm: ftpsync 20180513+nmu1 Β· GPL-2.0-only
- debian trixie: ftpsync 20180513+nmu1 Β· GPL-2.0-only
- ubuntu jammy: ftpsync 20180513+nmu1 Β· GPL-2.0-only
- ubuntu noble: ftpsync 20180513+nmu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms