Tasks are added into a JSON configuration file, named
tasks_config.json
this file must be created manually, in the /etc folder. Changes made to the file will be reflected only when the service/script is restarted.
The configuration file has this format:
{
"tasks": [
{
"workDir": "/path/to/working/dir",
"cmd": "command to execute",
"runsOn": []
},
{
"workDir": "/path/to/working/dir",
"cmd": "another command to execute",
"runsOn": [
"00:00:00",
"14:00:00"
]
}
]
}
-
workDir is the working directory on where to run the command
-
cmd is the command to run
-
runsOn is a list storing 24h formatted clock strings "HH:MM:SS", if this list is empty, the command will be runned on service start. Otherwise it will schedule command execution based on these times.
sudo nano /etc/tasks_config.json
Either download the zip and extract the source folder, or run
git clone https://github.com/st1vms/linux-task-helper
cd into the source folder and run:
chmod u+x ./install.sh
run the installation script using:
./install.sh
NOTE: you don't have to run these commands as sudo, but sudo password will be asked in any case as it's required for a few tasks.
systemctl enable linux-task-helper.service
systemctl start linux-task-helper.service
systemctl status linux-task-helper.service
chmod u+x ./uninstall.sh && ./uninstall.sh