diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-11-29 15:13:11 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-11-29 15:13:11 -0800 |
commit | a88756a60a04f469139077268338c10af29e85df (patch) | |
tree | f7462e6ee33af2f9fa7ac0191f1a21190e309469 /datestamp.sh | |
download | mastermirror-scripts-a88756a60a04f469139077268338c10af29e85df.tar.gz mastermirror-scripts-a88756a60a04f469139077268338c10af29e85df.tar.bz2 mastermirror-scripts-a88756a60a04f469139077268338c10af29e85df.zip |
Initial commit.
Copied from git+ssh://git@git.gentoo.org/infra/cfengine.git repo as:
timestamp 2015-11-29T21:57:00Z
commit 3b63da8fbbb848d5a1f7e7cd7c6989638ed0d817
No passwords, passphrases or key material is contained herein, but it
may reference the pathes to such.
Reviewed-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'datestamp.sh')
-rwxr-xr-x | datestamp.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/datestamp.sh b/datestamp.sh new file mode 100755 index 0000000..de6ef9a --- /dev/null +++ b/datestamp.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# distributed by cfengine + +umask 022 # ensure globally readable perms on new files for rsyncd + +source /usr/local/bin/mastermirror/rsync-gen.vars + +# The only time ${STAGEDIR}/metadata should not exist is when rsync-gen.sh +# hasn't ran even once yet +if [[ -d ${STAGEDIR}/metadata ]]; then + /bin/date -u '+%s %c' > ${STAGEDIR}/metadata/timestamp.x.tmp + /bin/mv ${STAGEDIR}/metadata/timestamp.x.tmp ${STAGEDIR}/metadata/timestamp.x +fi + +if [[ -d ${FINALDIR}/metadata ]]; then + /bin/date -R -u > ${FINALDIR}/metadata/timestamp.chk.tmp + /bin/mv ${FINALDIR}/metadata/timestamp.chk.tmp ${FINALDIR}/metadata/timestamp.chk +fi |