Skip to content

Commit

Permalink
using systemd timer to replace crontab
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefal committed Jun 4, 2020
1 parent 72f2593 commit 4199e11
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion copy_unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

BASEDIR=$(dirname "$0")

for file_path in ${BASEDIR}/unit/*.service
for file_path in ${BASEDIR}/unit/*.service ${BASEDIR}/unit/*.timer
do
file_name=$(basename ${file_path})
echo copying ${file_name}
Expand Down
1 change: 0 additions & 1 deletion tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ main() {
rtkbase_requirements && \
install_unit_files && \
install_gpsd_chrony && \
add_crontab && \
detect_usb_gnss && \
configure_gnss && \
start_services ;fi
Expand Down
7 changes: 7 additions & 0 deletions unit/rtkbase_archive.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=RTKBase - Archiving and cleaning raw data

[Service]
Type=oneshot
User={user}
ExecStart={script_path}/archive_and_clean.sh
9 changes: 9 additions & 0 deletions unit/rtkbase_archive.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Run rtkbase_archive.service everyday at 04H00

[Timer]
OnCalendar=*-*-* 04:00:00
Persistent=true

[Install]
WantedBy=timers.target

0 comments on commit 4199e11

Please sign in to comment.