[update] Added scheduler systemd timer to sats-update regularly

This commit is contained in:
xdrm-brackets 2017-05-09 13:07:11 +02:00
parent 1653b1acf0
commit 44b11cd266
2 changed files with 20 additions and 4 deletions

View File

@ -247,7 +247,7 @@ step6(){
# [7] Set up systemd services # [7] Set up systemd services
#========================================================# #========================================================#
step7(){ step7(){
echo -e "\n>>> [7] Set up systemd background"; echo -e "\n>>> [7] Set up systemd units";
# (0) Create useful folders # # (0) Create useful folders #
@ -287,13 +287,20 @@ step7(){
# (8) Create sats-update script # # (8) Create sats-update script #
echo " (.) Create sats-update script"; echo " (.) Create sats-update script";
cat ./utility/sats-update | sudo tee /mnt/service/sats-update > /dev/null; cat ./utility/sats-update | sudo tee /mnt/service/sats-update > /dev/null;
# (8) Create sats-loop script # # (8) Create sats-loop script #
echo " (.) Create sats-loop script"; echo " (.) Create sats-loop script";
cat ./utility/sats-loop | sudo tee /mnt/service/sats-loop > /dev/null; cat ./utility/sats-loop | sudo tee /mnt/service/sats-loop > /dev/null;
# (9) Set up permissions # # (9) Create sats-update timer #
echo " (.) Create sats-update timer";
echo " - Create sats-loop.timer file";
cat ./utility/sats-update.timer | sudo tee /mnt/service/sats-update.timer > /dev/null;
echo " - Emulate \`systemctl enable sats-loop.timer\`";
sudo ln -fs /lib/systemd/system/sats-update.timer /mnt/etc/systemd/system/multi-user.target.wants/sats-update.timer;
# (10) Set up permissions #
echo " (.) Set up permissions"; echo " (.) Set up permissions";
echo " - sats-install @pi"; echo " - sats-install @pi";
sudo chown 1000:1000 /mnt/service/sats-install; sudo chown 1000:1000 /mnt/service/sats-install;

View File

@ -0,0 +1,9 @@
[Unit]
Description=Timer to schedule sats-update (every minute)
Before=sats-update.service
[Timer]
OnCalendar=*-*-* *:*:00
[Install]
WantedBy=multi-user.target