generated from NethServer/ns8-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sync-head 15-minutes timer script
This new script update repodata contents from NS8 upstream repository. Its copied contents are used to see modules in the Software Center page, as opposed to the take-snapshot script, which manages the content for the nightly update cronjob of subscription installations.
- Loading branch information
1 parent
06a5832
commit 830ae03
Showing
6 changed files
with
99 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright (C) 2024 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
set -e | ||
shopt -s nullglob | ||
|
||
# shellcheck disable=SC1091 | ||
source /etc/nethserver/core.env | ||
new_head=tmp.$(date +head.%Y%m%dt%H%I%S%2N) | ||
rsync_opts=(-aiSH --no-motd --no-super --no-perms --chmod=ugo=rwX --no-g --no-o --delete-after) | ||
distfeed_url=https://github.com/NethServer/ns8-repomd/archive/refs/heads/repomd.tar.gz | ||
|
||
cd /srv/porthos/webroot | ||
|
||
trap 'rm -rf remove."${new_head}" "${new_head}"' EXIT | ||
|
||
printf "Sync distfeed head from %s\n" "${distfeed_url}" | ||
mkdir -vp "${new_head}/distfeed" head | ||
curl --fail -L -O --output-dir "${new_head}" "${distfeed_url}" | ||
tar -z -x --strip-components=1 -f "${new_head}/repomd.tar.gz" -C "${new_head}/distfeed" | ||
rm -f "${new_head}/repomd.tar.gz" | ||
|
||
# Substitute the head directory with new_head | ||
mv head remove."${new_head}" | ||
mv -v "${new_head}" head | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# Copyright (C) 2023 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
[Unit] | ||
Description=Scheduled Porthos sync-head procedure | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=runagent sync-head | ||
SyslogIdentifier=%N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Copyright (C) 2023 Nethesis S.r.l. | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
|
||
[Unit] | ||
Description=Timer of Porthos sync-head procedure | ||
|
||
[Timer] | ||
OnCalendar=Mon..Fri *-*-* 07..17:00,15,45:00 UTC | ||
|
||
[Install] | ||
WantedBy=timers.target |