Configuring a Nightly Job¶
Note
This guide assumes that you have already installed EpicPrefill on your system. If you have not yet installed EpicPrefill, see Linux Setup Guide
Configuring The Schedule¶
We will first need to configure a timer
which will configure the schedule that EpicPrefill will run on. In this example, we will setup a schedule that will run nightly at 4am local time.
You should create a new file named /etc/systemd/system/epicprefill.timer
, and save the following configuration into that file.
[Unit]
Description=EpicPrefill run daily
Requires=epicprefill.service
[Timer]
# Runs every day at 4am (local time)
OnCalendar=*-*-* 4:00:00
# Set to true so we can store when the timer last triggered on disk.
Persistent=true
[Install]
WantedBy=timers.target
Configuring The Job¶
Next, we will setup the job that will be triggered nightly by the timer
that we previously setup. Create a new file /etc/systemd/system/epicprefill.service
, and save the following configuration into the file.
Note
The values of User
, WorkingDirectory
, and ExecStart
will need to be configured to point to your EpicPrefill install location.
[Unit]
Description=EpicPrefill
After=remote-fs.target
Wants=remote-fs.target
[Service]
# Replace with your username
User=
# Set this to the directory where EpicPrefill is installed.
# Example : /home/tim/EpicPrefill
WorkingDirectory=
# This should be the full path to EpicPrefill, as well as any additional option flags
# Example: /home/tim/EpicPrefill/EpicPrefill prefill --no-ansi
ExecStart=
Type=oneshot
Nice=19
[Install]
WantedBy=multi-user.target
Once these two files are setup, you can enable the scheduled job with:
sudo systemctl daemon-reload
sudo systemctl enable --now epicprefill.timer
sudo systemctl enable epicprefill
If everything was configured correctly, you should see similar output from running sudo systemctl status epicprefill.timer
Checking Service Logs¶
It is possible to check on the status of the service using sudo systemctl status epicprefill
, which will display both the service's status as well as its most recent logs.