Compare commits

...

14 Commits
2.8 ... master

Author SHA1 Message Date
Darko Poljak b50b3f64dc Update gitignore 2020-11-25 16:21:44 +01:00
Darko Poljak 40dbfbd3a3 Fix test: also count 'current' symlink 2020-11-25 16:20:28 +01:00
Darko Poljak 7d298d2b51 ++changelog 2020-11-25 16:17:29 +01:00
poljakowski 3687267dd7 Merge branch 'fix-current-symlink' into 'master'
Improve 'current' symlink to backup destinations

See merge request ungleich-public/ccollect!16
2020-11-25 16:15:27 +01:00
Jun Futagawa 2ca7598593 Improve 'current' symlink to backup destinations 2020-11-25 11:24:37 +09:00
Darko Poljak 08cb857664 Release 2.10 2020-08-26 08:36:43 +02:00
Darko Poljak 309d8dc773 ++changelog 2020-05-25 17:52:23 +02:00
poljakowski fabdefad82 Merge branch 'master' into 'master'
Add 'current' symlink to backup destinations

See merge request ungleich-public/ccollect!15
2020-05-25 17:51:13 +02:00
Steffen Zieger 616b1d9e3e Add 'current' symlink to backup destinations 2020-05-25 16:16:32 +02:00
Darko Poljak 7a7dec7751 Release 2.9 2020-05-25 12:05:35 +02:00
Darko Poljak 28dec3694a ++changelog 2020-05-24 17:29:29 +02:00
poljakowski 59b50e7f4b Merge branch 'ungleich-master-patch-28394' into 'master'
make rsync return code available in post_exec

See merge request ungleich-public/ccollect!14
2020-05-24 17:28:31 +02:00
Steffen Zieger a261ef841e make rsync return code available in post_exec 2020-05-24 16:40:04 +02:00
Darko Poljak 109b70ea76 gitlab runner should have necessary tools 2019-12-02 09:29:02 +01:00
8 changed files with 25 additions and 14 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ doc/*.xml
doc/*/*.xml
*.texi
*.fo
*.lock

View File

@ -3,18 +3,10 @@ stages:
unit_tests:
stage: test
before_script:
- 'apk update'
- 'apk add make rsync'
script:
- make test
shellcheck:
stage: test
before_script:
- 'apk update'
- 'apk add make'
- 'wget https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz'
- 'tar xf shellcheck-stable.linux.x86_64.tar.xz && mv shellcheck-stable/shellcheck /usr/bin/'
script:
- make shellcheck

View File

@ -235,13 +235,13 @@ test-interval-changing: $(CCOLLECT_SOURCE) test-dir-source test-dir-destination-
test "$$(ls -1 /tmp/ccollect/backup-chint | wc -l)" -eq "0" || { cat ${TEST_LOG_FILE}; exit 1; }
printf "3" > ./test/conf/sources/local-with-interval/intervals/daily
for x in 1 2 3 4 5; do CCOLLECT_CONF=./test/conf ./ccollect -l ${TEST_LOG_FILE} daily local-with-interval; done
test "$$(ls -1 /tmp/ccollect/backup-chint | wc -l)" -eq "3" || { cat ${TEST_LOG_FILE}; exit 1; }
test "$$(ls -1 /tmp/ccollect/backup-chint | wc -l)" -eq "4" || { cat ${TEST_LOG_FILE}; exit 1; }
printf "5" > ./test/conf/sources/local-with-interval/intervals/daily
for x in 1 2 3 4 5 6 7; do CCOLLECT_CONF=./test/conf ./ccollect -l ${TEST_LOG_FILE} daily local-with-interval; done
test "$$(ls -1 /tmp/ccollect/backup-chint | wc -l)" -eq "5" || { cat ${TEST_LOG_FILE}; exit 1; }
test "$$(ls -1 /tmp/ccollect/backup-chint | wc -l)" -eq "6" || { cat ${TEST_LOG_FILE}; exit 1; }
printf "4" > ./test/conf/sources/local-with-interval/intervals/daily
for x in 1 2 3 4 5 6; do CCOLLECT_CONF=./test/conf ./ccollect -l ${TEST_LOG_FILE} daily local-with-interval; done
test "$$(ls -1 /tmp/ccollect/backup-chint | wc -l)" -eq "4" || { cat ${TEST_LOG_FILE}; exit 1; }
test "$$(ls -1 /tmp/ccollect/backup-chint | wc -l)" -eq "5" || { cat ${TEST_LOG_FILE}; exit 1; }
printf "3" > ./test/conf/sources/local-with-interval/intervals/daily
@printf "\nInterval changing test ended successfully\n"

View File

@ -45,8 +45,8 @@ TMP="$(mktemp "/tmp/${__myname}.XXXXXX")"
export TMP
CONTROL_PIPE="/tmp/${__myname}-control-pipe"
VERSION="2.8"
RELEASE="2019-11-26"
VERSION="2.10"
RELEASE="2020-08-26"
HALF_VERSION="ccollect ${VERSION}"
FULL_VERSION="ccollect ${VERSION} (${RELEASE})"
@ -824,6 +824,11 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
rsync "$@" "${source}" "${destination_dir}"; ret=$?
_techo "Finished backup (rsync return code: $ret)."
#
# export rsync return code, might be useful in post_exec
#
export rsync_return_code=$ret
#
# Set modification time (mtime) to current time, if sorting by mtime is enabled
#
@ -856,6 +861,16 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
_techo "Warning: rsync failed with return code $ret."
fi
#
# Create symlink to newest backup
#
# shellcheck disable=SC2010
latest_dir="$(ls -${TSORT}p1 "${ddir}" | grep '/$' | head -n 1)" || \
_exit_err "Failed to list content of ${ddir}."
ln -snf "${ddir}/${latest_dir}" "${ddir}/current" || \
_exit_err "Failed to create 'current' symlink."
#
# post_exec
#

View File

@ -1,7 +1,7 @@
ccollect - Installing, Configuring and Using
============================================
Nico Schottelius <nico-ccollect__@__schottelius.org>
2.8, for ccollect 2.8, Initial Version from 2006-01-13
2.10, for ccollect 2.10, Initial Version from 2006-01-13
:Author Initials: NS

1
doc/changes/2.10 Normal file
View File

@ -0,0 +1 @@
* Add 'current' symlink to backup destinations (Steffen Zieger)

1
doc/changes/2.9 Normal file
View File

@ -0,0 +1 @@
* Make rsync return code available in post_exec (Steffen Zieger)

1
doc/changes/next Normal file
View File

@ -0,0 +1 @@
* Fix 'current' symlink (Jun Futagawa)