diff --git a/copy_unit.sh b/copy_unit.sh index ff0c2a7d..f87c441c 100755 --- a/copy_unit.sh +++ b/copy_unit.sh @@ -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} diff --git a/tools/install.sh b/tools/install.sh index feece9c7..8504e6c9 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -351,7 +351,6 @@ main() { rtkbase_requirements && \ install_unit_files && \ install_gpsd_chrony && \ - add_crontab && \ detect_usb_gnss && \ configure_gnss && \ start_services ;fi diff --git a/unit/rtkbase_archive.service b/unit/rtkbase_archive.service new file mode 100644 index 00000000..0f1ef146 --- /dev/null +++ b/unit/rtkbase_archive.service @@ -0,0 +1,7 @@ +[Unit] +Description=RTKBase - Archiving and cleaning raw data + +[Service] +Type=oneshot +User={user} +ExecStart={script_path}/archive_and_clean.sh \ No newline at end of file diff --git a/unit/rtkbase_archive.timer b/unit/rtkbase_archive.timer new file mode 100644 index 00000000..ea3a5130 --- /dev/null +++ b/unit/rtkbase_archive.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run rtkbase_archive.service everyday at 04H00 + +[Timer] +OnCalendar=*-*-* 04:00:00 +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file