git/Documentation
Lénaïc Huard b681b191f9 maintenance: add support for systemd timers on Linux
The existing mechanism for scheduling background maintenance is done
through cron. On Linux systems managed by systemd, systemd provides an
alternative to schedule recurring tasks: systemd timers.

The main motivations to implement systemd timers in addition to cron
are:
* cron is optional and Linux systems running systemd might not have it
  installed.
* The execution of `crontab -l` can tell us if cron is installed but not
  if the daemon is actually running.
* With systemd, each service is run in its own cgroup and its logs are
  tagged by the service inside journald. With cron, all scheduled tasks
  are running in the cron daemon cgroup and all the logs of the
  user-scheduled tasks are pretended to belong to the system cron
  service.
  Concretely, a user that doesn’t have access to the system logs won’t
  have access to the log of their own tasks scheduled by cron whereas
  they will have access to the log of their own tasks scheduled by
  systemd timer.
  Although `cron` attempts to send email, that email may go unseen by
  the user because these days, local mailboxes are not heavily used
  anymore.

In order to schedule git maintenance, we need two unit template files:
* ~/.config/systemd/user/git-maintenance@.service
  to define the command to be started by systemd and
* ~/.config/systemd/user/git-maintenance@.timer
  to define the schedule at which the command should be run.

Those units are templates that are parameterized by the frequency.

Based on those templates, 3 timers are started:
* git-maintenance@hourly.timer
* git-maintenance@daily.timer
* git-maintenance@weekly.timer

The command launched by those three timers are the same as with the
other scheduling methods:

/path/to/git for-each-repo --exec-path=/path/to
--config=maintenance.repo maintenance run --schedule=%i

with the full path for git to ensure that the version of git launched
for the scheduled maintenance is the same as the one used to run
`maintenance start`.

The timer unit contains `Persistent=true` so that, if the computer is
powered down when a maintenance task should run, the task will be run
when the computer is back powered on.

Signed-off-by: Lénaïc Huard <lenaic@lhuard.fr>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-07 10:57:04 -07:00
..
RelNotes Git 2.32-rc1 2021-05-22 18:29:01 +09:00
config Merge branch 'dl/stash-show-untracked-fixup' 2021-05-22 18:29:01 +09:00
howto Document how we do embargoed releases 2021-03-27 15:13:12 -07:00
technical Merge branch 'jt/push-negotiation' 2021-05-16 21:05:22 +09:00
.gitattributes
.gitignore
CodingGuidelines Merge branch 'jc/test-allows-local' 2021-05-11 15:27:22 +09:00
Makefile Merge branch 'ab/doc-lint' 2021-05-07 12:47:40 +09:00
MyFirstContribution.txt
MyFirstObjectWalk.txt
SubmittingPatches doc: clarify "do not capitalize the first word" rule 2021-04-14 23:41:00 -07:00
asciidoc.conf
asciidoctor-extensions.rb
blame-options.txt blame-options.txt: camelcase blame.blankBoundary 2021-02-24 15:21:25 -08:00
build-docdep.perl
cat-texi.perl
cmd-list.perl
config.txt Merge branch 'km/config-doc-typofix' 2021-03-19 15:25:38 -07:00
date-formats.txt doc: mention approxidates for git-commit --date 2021-02-23 13:33:02 -08:00
diff-format.txt
diff-generate-patch.txt doc: point to diff attribute in patch format docs 2021-04-28 13:34:44 +09:00
diff-options.txt Merge branch 'ab/pathname-encoding-doc' 2021-04-30 13:50:27 +09:00
doc-diff
docbook-xsl.css
docbook.xsl
everyday.txto
fetch-options.txt fetch: add --prefetch option 2021-04-16 13:36:55 -07:00
fix-texi.perl
git-add.txt
git-am.txt am: learn to process quoted lines that ends with CRLF 2021-05-10 15:06:22 +09:00
git-annotate.txt
git-apply.txt git-apply: allow simultaneous --cached and --3way options 2021-04-07 22:20:33 -07:00
git-archimport.txt
git-archive.txt
git-bisect-lk2009.txt
git-bisect.txt
git-blame.txt
git-branch.txt Merge branch 'jc/maint-column-doc-typofix' 2021-02-25 16:43:30 -08:00
git-bugreport.txt
git-bundle.txt
git-cat-file.txt git-cat-file.txt: remove references to "sha1" 2021-03-03 16:43:06 -08:00
git-check-attr.txt
git-check-ignore.txt
git-check-mailmap.txt
git-check-ref-format.txt
git-checkout-index.txt
git-checkout.txt
git-cherry-pick.txt
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt builtin/clone.c: add --reject-shallow option 2021-04-01 12:58:58 -07:00
git-column.txt
git-commit-graph.txt
git-commit-tree.txt
git-commit.txt Merge branch 'zh/commit-trailer' 2021-04-07 16:54:08 -07:00
git-config.txt config: allow overriding of global and system configuration 2021-04-19 14:16:59 -07:00
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt
git-credential.txt doc lint: lint and fix missing "GIT" end sections 2021-04-10 23:36:34 -07:00
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt docs: fix linting issues due to incorrect relative section order 2021-04-10 23:36:34 -07:00
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt difftool.c: learn a new way start at specified file 2021-02-22 13:35:49 -08:00
git-fast-export.txt
git-fast-import.txt
git-fetch-pack.txt
git-fetch.txt
git-filter-branch.txt
git-fmt-merge-msg.txt
git-for-each-ref.txt ref-filter: use pretty.c logic for trailers 2021-02-15 16:48:38 -08:00
git-for-each-repo.txt
git-format-patch.txt Merge branch 'jk/doc-format-patch-skips-merges' 2021-05-11 15:27:23 +09:00
git-fsck-objects.txt
git-fsck.txt
git-gc.txt
git-get-tar-commit-id.txt
git-grep.txt docs: fix linting issues due to incorrect relative section order 2021-04-10 23:36:34 -07:00
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt
git-http-fetch.txt http-fetch: allow custom index-pack args 2021-02-22 12:07:40 -08:00
git-http-push.txt
git-imap-send.txt
git-index-pack.txt Merge branch 'jt/transfer-fsck-across-packs' 2021-03-01 14:02:57 -08:00
git-init-db.txt
git-init.txt
git-instaweb.txt
git-interpret-trailers.txt trailer: add new .cmd config option 2021-05-04 12:09:43 +09:00
git-log.txt
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt mailinfo: allow stripping quoted CR without warning 2021-05-10 15:06:22 +09:00
git-mailsplit.txt
git-maintenance.txt maintenance: add support for systemd timers on Linux 2021-09-07 10:57:04 -07:00
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt
git-mergetool--lib.txt
git-mergetool.txt doc: describe mergetool configuration in git-mergetool(1) 2021-03-13 15:34:32 -08:00
git-mktag.txt docs: fix linting issues due to incorrect relative section order 2021-04-10 23:36:34 -07:00
git-mktree.txt
git-multi-pack-index.txt midx: allow marking a pack as preferred 2021-04-01 13:07:37 -07:00
git-mv.txt
git-name-rev.txt
git-notes.txt
git-p4.txt doc lint: lint and fix missing "GIT" end sections 2021-04-10 23:36:34 -07:00
git-pack-objects.txt Merge branch 'tb/geometric-repack' 2021-03-24 14:36:27 -07:00
git-pack-redundant.txt
git-pack-refs.txt
git-patch-id.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt
git-push.txt Documentation/git-push.txt: correct configuration typo 2021-03-13 15:41:45 -08:00
git-quiltimport.txt
git-range-diff.txt Merge branch 'js/range-diff-one-side-only' 2021-02-17 17:21:41 -08:00
git-read-tree.txt
git-rebase.txt Merge branch 'ab/rebase-no-reschedule-failed-exec' 2021-05-07 12:47:40 +09:00
git-receive-pack.txt
git-reflog.txt
git-remote-ext.txt
git-remote-fd.txt
git-remote-helpers.txto
git-remote.txt
git-repack.txt git-repack.txt: remove spurious ")" 2021-05-10 14:12:47 +09:00
git-replace.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt
git-restore.txt
git-rev-list.txt docs/rev-list: add some examples of --disk-usage 2021-02-17 16:25:29 -08:00
git-rev-parse.txt
git-revert.txt
git-rm.txt rm: honor sparse checkout patterns 2021-04-08 14:18:03 -07:00
git-send-email.txt
git-send-pack.txt
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt
git-sparse-checkout.txt sparse-checkout: toggle sparse index from builtin 2021-03-30 12:57:48 -07:00
git-stage.txt
git-stash.txt stash show: use stash.showIncludeUntracked even when diff options given 2021-05-22 17:56:46 +09:00
git-status.txt Documentation: typofix --column description 2021-02-19 19:36:47 -08:00
git-stripspace.txt
git-submodule.txt
git-svn.txt docs: fix linting issues due to incorrect relative section order 2021-04-10 23:36:34 -07:00
git-switch.txt
git-symbolic-ref.txt
git-tag.txt Documentation: typofix --column description 2021-02-19 19:36:47 -08:00
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-commit.txt
git-verify-pack.txt
git-verify-tag.txt
git-web--browse.txt
git-whatchanged.txt
git-worktree.txt
git-write-tree.txt
git.txt Merge branch 'ps/config-global-override' 2021-05-07 12:47:39 +09:00
gitattributes.txt docs: document symlink restrictions for dot-files 2021-05-04 11:52:03 +09:00
gitcli.txt
gitcore-tutorial.txt
gitcredentials.txt
gitcvs-migration.txt
gitdiffcore.txt Merge branch 'en/ort-perf-batch-8' 2021-03-22 14:00:24 -07:00
giteveryday.txt
gitfaq.txt
gitglossary.txt
githooks.txt githooks.txt: clarify documentation on reference-transaction hook 2021-03-01 09:02:01 -08:00
gitignore.txt docs: document symlink restrictions for dot-files 2021-05-04 11:52:03 +09:00
gitk.txt
gitmailmap.txt docs: document symlink restrictions for dot-files 2021-05-04 11:52:03 +09:00
gitmodules.txt docs: document symlink restrictions for dot-files 2021-05-04 11:52:03 +09:00
gitnamespaces.txt doc lint: lint and fix missing "GIT" end sections 2021-04-10 23:36:34 -07:00
gitremote-helpers.txt
gitrepository-layout.txt
gitrevisions.txt
gitsubmodules.txt
gittutorial-2.txt
gittutorial.txt
gitweb.conf.txt gitweb: add "e-mail privacy" feature to redact e-mail addresses 2021-04-08 15:54:26 -07:00
gitweb.txt
gitworkflows.txt
glossary-content.txt
howto-index.sh
i18n.txt i18n.txt: camel case and monospace "i18n.commitEncoding" 2021-02-24 15:21:25 -08:00
install-doc-quick.sh
install-webdoc.sh
line-range-format.txt
line-range-options.txt
lint-gitlink.perl doc lint: fix bugs in, simplify and improve lint script 2021-04-10 23:36:34 -07:00
lint-man-end-blurb.perl doc lint: lint and fix missing "GIT" end sections 2021-04-10 23:36:34 -07:00
lint-man-section-order.perl docs: fix linting issues due to incorrect relative section order 2021-04-10 23:36:34 -07:00
manpage-base-url.xsl.in
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage.xsl
merge-options.txt
merge-strategies.txt
object-format-disclaimer.txt
pretty-formats.txt Merge branch 'ls/typofix' 2021-05-16 21:05:24 +09:00
pretty-options.txt
pull-fetch-param.txt
ref-reachability-filters.txt
rev-list-description.txt
rev-list-options.txt rev-list: allow filtering of provided items 2021-04-19 14:09:11 -07:00
revisions.txt
sequencer.txt
signoff-option.txt
texi.xsl
trace2-target-values.txt
transfer-data-leaks.txt
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt user-manual.txt: assign preface an id and a title 2021-04-03 23:19:04 -07:00