From 589fed6107e4cd0c719e523b81f1ae7ff5b55677 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 25 Nov 2019 14:41:41 +0100 Subject: [PATCH 01/14] ++changelog --- doc/changes/next | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changes/next diff --git a/doc/changes/next b/doc/changes/next new file mode 100644 index 0000000..563b438 --- /dev/null +++ b/doc/changes/next @@ -0,0 +1 @@ +* Fix excluding destination dir from removal From 987277f1cf2d02f2c2e527c423f90becd0e0b4f9 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 25 Nov 2019 20:52:48 +0100 Subject: [PATCH 02/14] Update Makefile Simplify and generalize. --- Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 1e783fc..789e099 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ ASCIIDOC=asciidoc DOCBOOKTOTEXI=docbook2x-texi DOCBOOKTOMAN=docbook2x-man XSLTPROC=xsltproc -XSL=/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl +XSL=/usr/local/share/xsl/docbook/html/docbook.xsl A2X=a2x prefix=/usr/packages/ccollect-git @@ -41,11 +41,7 @@ manlink=/usr/local/man/man1 path_dir=/usr/local/bin path_destination=${path_dir}/${CCOLLECT_DEST} - -# where to publish -host=localhost -dir=/home/users/nico/privat/rechner/netz/seiten/www.nico.schottelius.org/src/software/ccollect -docdir=${dir}/documentation +docs_archive_name=docs.tar # # Asciidoc will be used to generate other formats later @@ -91,6 +87,8 @@ all: @echo "info: only generate Texinfo" @echo "man: only generate manpage{s}" @echo "install: install ccollect to ${prefix}" + @echo "shellcheck: shellcheck ccollect script" + @echo "test: run unit tests" html: ${HTMLDOCS} htm: ${DBHTMLDOCS} @@ -179,9 +177,9 @@ pub: git push publish-doc: documentation - @echo "Transferring files to ${host}" @chmod a+r ${DOCS} ${DOC_ALL} - @tar c ${DOCS} ${DOC_ALL} | ssh ${host} "cd ${dir}; tar xv" + @tar cf ${docs_archive_name} ${DOCS} ${DOC_ALL} + @echo "Documentation files are in ${docs_archive_name}" # # Distribution From 5341de86fb331512dd442bbbcc8d68d20e6b06a5 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 26 Nov 2019 06:10:17 +0100 Subject: [PATCH 03/14] Release 2.8 --- ccollect | 4 ++-- doc/ccollect.text | 2 +- doc/changes/{next => 2.8} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename doc/changes/{next => 2.8} (100%) diff --git a/ccollect b/ccollect index 61e4ebd..39799cd 100755 --- a/ccollect +++ b/ccollect @@ -45,8 +45,8 @@ TMP="$(mktemp "/tmp/${__myname}.XXXXXX")" export TMP CONTROL_PIPE="/tmp/${__myname}-control-pipe" -VERSION="2.7" -RELEASE="2019-11-14" +VERSION="2.8" +RELEASE="2019-11-26" HALF_VERSION="ccollect ${VERSION}" FULL_VERSION="ccollect ${VERSION} (${RELEASE})" diff --git a/doc/ccollect.text b/doc/ccollect.text index 2478265..84c326e 100644 --- a/doc/ccollect.text +++ b/doc/ccollect.text @@ -1,7 +1,7 @@ ccollect - Installing, Configuring and Using ============================================ Nico Schottelius -2.7, for ccollect 2.7, Initial Version from 2006-01-13 +2.8, for ccollect 2.8, Initial Version from 2006-01-13 :Author Initials: NS diff --git a/doc/changes/next b/doc/changes/2.8 similarity index 100% rename from doc/changes/next rename to doc/changes/2.8 From 109b70ea769755fbb576e3ee83af399fb5735e9e Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 2 Dec 2019 09:26:47 +0100 Subject: [PATCH 04/14] gitlab runner should have necessary tools --- .gitlab-ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b499ddc..5391f4d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 From a261ef841eb76595d169eef334b8f004a2d3737c Mon Sep 17 00:00:00 2001 From: Steffen Zieger Date: Sun, 24 May 2020 16:40:04 +0200 Subject: [PATCH 05/14] make rsync return code available in post_exec --- ccollect | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ccollect b/ccollect index 39799cd..679e3ca 100755 --- a/ccollect +++ b/ccollect @@ -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 # From 28dec3694ae11b3924ba76c7de830183857d08bd Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 24 May 2020 17:29:29 +0200 Subject: [PATCH 06/14] ++changelog --- doc/changes/next | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changes/next diff --git a/doc/changes/next b/doc/changes/next new file mode 100644 index 0000000..45097c7 --- /dev/null +++ b/doc/changes/next @@ -0,0 +1 @@ +* Make rsync return code available in post_exec (Steffen Zieger) From 7a7dec7751862ca1eec30f2041c80e40746766b3 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 25 May 2020 12:05:35 +0200 Subject: [PATCH 07/14] Release 2.9 --- ccollect | 4 ++-- doc/ccollect.text | 2 +- doc/changes/{next => 2.9} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename doc/changes/{next => 2.9} (100%) diff --git a/ccollect b/ccollect index 679e3ca..01c5d05 100755 --- a/ccollect +++ b/ccollect @@ -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.9" +RELEASE="2020-05-25" HALF_VERSION="ccollect ${VERSION}" FULL_VERSION="ccollect ${VERSION} (${RELEASE})" diff --git a/doc/ccollect.text b/doc/ccollect.text index 84c326e..bc8326a 100644 --- a/doc/ccollect.text +++ b/doc/ccollect.text @@ -1,7 +1,7 @@ ccollect - Installing, Configuring and Using ============================================ Nico Schottelius -2.8, for ccollect 2.8, Initial Version from 2006-01-13 +2.9, for ccollect 2.9, Initial Version from 2006-01-13 :Author Initials: NS diff --git a/doc/changes/next b/doc/changes/2.9 similarity index 100% rename from doc/changes/next rename to doc/changes/2.9 From 616b1d9e3e9cf996e1f90bfc8ede58143ed0e7e7 Mon Sep 17 00:00:00 2001 From: Steffen Zieger Date: Mon, 25 May 2020 16:16:32 +0200 Subject: [PATCH 08/14] Add 'current' symlink to backup destinations --- ccollect | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ccollect b/ccollect index 01c5d05..b4af2f1 100755 --- a/ccollect +++ b/ccollect @@ -861,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 # From 309d8dc773182a053619a93bc099f88f087b4c0e Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 25 May 2020 17:52:23 +0200 Subject: [PATCH 09/14] ++changelog --- doc/changes/next | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changes/next diff --git a/doc/changes/next b/doc/changes/next new file mode 100644 index 0000000..1d1e85d --- /dev/null +++ b/doc/changes/next @@ -0,0 +1 @@ +* Add 'current' symlink to backup destinations (Steffen Zieger) From 08cb857664a6dbcbacaffc020c747db554ebbf15 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 26 Aug 2020 08:36:43 +0200 Subject: [PATCH 10/14] Release 2.10 --- ccollect | 4 ++-- doc/ccollect.text | 2 +- doc/changes/{next => 2.10} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename doc/changes/{next => 2.10} (100%) diff --git a/ccollect b/ccollect index b4af2f1..2deaa2d 100755 --- a/ccollect +++ b/ccollect @@ -45,8 +45,8 @@ TMP="$(mktemp "/tmp/${__myname}.XXXXXX")" export TMP CONTROL_PIPE="/tmp/${__myname}-control-pipe" -VERSION="2.9" -RELEASE="2020-05-25" +VERSION="2.10" +RELEASE="2020-08-26" HALF_VERSION="ccollect ${VERSION}" FULL_VERSION="ccollect ${VERSION} (${RELEASE})" diff --git a/doc/ccollect.text b/doc/ccollect.text index bc8326a..f075b9a 100644 --- a/doc/ccollect.text +++ b/doc/ccollect.text @@ -1,7 +1,7 @@ ccollect - Installing, Configuring and Using ============================================ Nico Schottelius -2.9, for ccollect 2.9, Initial Version from 2006-01-13 +2.10, for ccollect 2.10, Initial Version from 2006-01-13 :Author Initials: NS diff --git a/doc/changes/next b/doc/changes/2.10 similarity index 100% rename from doc/changes/next rename to doc/changes/2.10 From 2ca7598593befc52bff6b51b330bbcf508e20387 Mon Sep 17 00:00:00 2001 From: Jun Futagawa Date: Wed, 25 Nov 2020 11:24:37 +0900 Subject: [PATCH 11/14] Improve 'current' symlink to backup destinations --- ccollect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccollect b/ccollect index 2deaa2d..8b8f9e5 100755 --- a/ccollect +++ b/ccollect @@ -868,7 +868,7 @@ while [ "${source_no}" -lt "${no_sources}" ]; do 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" || \ + ln -snf "${ddir}/${latest_dir}" "${ddir}/current" || \ _exit_err "Failed to create 'current' symlink." # From 7d298d2b51f30f95407e2bdfc8e4e04fb14f66e2 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 25 Nov 2020 16:17:29 +0100 Subject: [PATCH 12/14] ++changelog --- doc/changes/next | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changes/next diff --git a/doc/changes/next b/doc/changes/next new file mode 100644 index 0000000..81efe7b --- /dev/null +++ b/doc/changes/next @@ -0,0 +1 @@ +* Fix 'current' symlink (Jun Futagawa) From 40dbfbd3a38b2064b095bea621600be1637dbd2d Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 25 Nov 2020 16:20:28 +0100 Subject: [PATCH 13/14] Fix test: also count 'current' symlink --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 789e099..cda6d81 100644 --- a/Makefile +++ b/Makefile @@ -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" From b50b3f64dc86182f93c348b4ff9d286d70bc7d28 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 25 Nov 2020 16:21:44 +0100 Subject: [PATCH 14/14] Update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e5c18f6..6a82cbe 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ doc/*.xml doc/*/*.xml *.texi *.fo +*.lock