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 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/ restart

All done!


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...
Port Scan Test

How to check port forwarding is working

Problem-Outcome Summary This guide applies to:Any router or firewall you may have such as:DLink, Asus, TP Link, Linksys, Synology, Apple, Belkin, Buffalo, Cisco,...
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 Install Logitech Media Server on Ubuntu Linux

How to install Logitech Media Server on Ubuntu Linux

Problem / Outcome SummaryThis how to guide will enable you to install Logitech Media Server on Ubuntu Linux For how to install Logitech...

Related Stories

Stay on op - Ge the daily news in your inbox