Tuesday, December 10, 2019

How to: Edit Crontab on QNAP and keep the changes after a reboot

Problem / Outcome Summary

  • This article will show you how to make changes to crontab on a QNAP NAS and have them kept after a reboot
  • Please see the ‘Summary Overview’ tab below for a high level view of the objectives this ‘howto’ will achieve.

Why might I want to do this?

  • If you want to add a scheduled task to your QNAP NAS, you would undoubtedly want to know that it saves permanently
  • The normal method for saving your crontab does not work on a QNAP NAS after it is rebooted

To be clear, what does Crontab do?

Simply put, crontab is a process that runs on *nix based systems (that’s Unix, Linux, BSD etc) and schedules programs to run on preset schedules.  Common types of things ‘triggered’ by the crontab process are backups, email server tasks, log rotations and database maintenance.

How does Crontab work?

Crontab works by processing a list in a textfile (the crontab file), in order and processing it as per your configuration.  In that configuration, you point it at other programs or files and say to them to run at your configured schedule.

An example of a line in crontab is shown below:

30     20     *     *     *         rm /home/someuser/tmp/*

There are plenty of detailed examples on how crontab works on the internet such as this at adminschoice.com which will explain the format of the above crontab line.

So how do I make the changes stick after a reboot?

This is really, really simple.

  1. Edit your crontab file eg: vi /etc/config/crontab
  2. Make crontab see the changes: crontab /etc/config/crontab
  3. Restart the crontab service: /etc/init.d/crond.sh restart

All done!

Marshalleq

Popular Articles

Raspberry Pi 3

Raspberry Pi Disk Images – Definitive List

This page attempts to list all the Raspberry Pi disk images known to currently exist from around the web, providing direct links to download...
Raspberry Pi Audio Hardware

Raspberry Pi audio HAT’s (Hardware Attached on Top) – Definitive List

Summary Back in July 2014, Raspberry Pi announced the then new, Raspberry Pi 2 followed soon after by the announcement of HaTs (Hardware Attached on...
How to set Plex permissions on Linux / NAS devices

How to set Plex permissions on linux or NAS devices

Problem / Outcome SummaryThis how to guide will show you how to properly set up Linux file permissions for Plex Media Server Please...
How to set up Plex on Raspberry Pi 2 or Raspberry Pi 3

How to Install Official Plex Media Player on Raspberry Pi 2 / Pi 3

This ‘How To’ article will show you step by step how to set up and install the official Plex Media Player on a...
Plex Media Server

How to install Plex Media Server on Ubuntu Server Headless

This howto will enable you to install the Plex Media Server on Ubuntu Server For how to install Plex Media Server on another...

Related Stories

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stay on op - Ge the daily news in your inbox