Last active
July 8, 2022 03:48
-
-
Save Rtoax/ffd75056a17b88ed039ef0e02b953587 to your computer and use it in GitHub Desktop.
DNF repo sync script
This file contains hidden or 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
#!/bin/bash | |
REPOSYNC_SCRIPTS_LIST=$(find -name reposync.sh) | |
for script in $REPOSYNC_SCRIPTS_LIST | |
do | |
cd $(dirname $script) | |
sh $(basename $script) | |
cd - | |
done | |
echo "Sync repo in $(date)" >> reposync.log |
This file contains hidden or 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
[Unit] | |
Description=Reposync | |
[Service] | |
PIDFile=/run/trigger-master.pid | |
ExecStart=/home/rongtao/repos/reposync-all.sh | |
ExecReload=/bin/kill -HUP $MAINPID | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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
#!/bin/bash | |
# 同步所有 repo | |
root_dir=$(dirname `realpath $0`) | |
cur_dir=$(pwd) | |
cd $root_dir | |
scripts=$(find -name allreposync.sh) | |
for s in $scripts | |
do | |
cd $(dirname $s) | |
sh $(basename $s) | |
cd - | |
done | |
cd $cur_dir | |
echo "Sync repo in $(date)" >> /tmp/reposync.log |
This file contains hidden or 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
[Unit] | |
Description=Repo sync | |
[Timer] | |
#OnUnitActiveSec=*-*-* 01:00:00 | |
OnCalendar=*-*-* 01:00:00 | |
Unit=reposync-all.service | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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
#!/bin/bash | |
dnf --repoid=os \ | |
--repofrompath=os,https://mirrors.bfsu.edu.cn/centos-stream/9-stream/BaseOS/x86_64/os/ \ | |
--download-metadata \ | |
--remote-time \ | |
reposync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment