My Setup
Before diving into the steps, here is a quick overview of the setup used in this guide.
Device: QNAP TS-253D
Firmware: QTS 5.2.9.3451
RAM: 32GB (the TS-253D supports up to 32GB, so this unit is fully maxed out)
Role: The NAS handles several critical services simultaneously, including Home Assistant backups (synced directly via SMB), a Samba file share used as a network drive on Windows, and general NAS storage duties. It also runs QBoost and several other QNAP apps in the background.
Because the NAS is always on and running multiple services, memory tends to fill up over time with cached data that is no longer needed. Scheduling a daily memory optimization at 3:00 AM — when the system is at its quietest — keeps things running smoothly without any manual effort.
If you own a QNAP NAS, you may already know that QBoost can free up unused cached memory with a single click. However, what many users don’t realize is that there is no built-in scheduler for this feature. In this guide, you will learn how to automate QBoost memory optimization on your QNAP NAS using crontab, so it runs every day without any manual intervention.
Â
Why Schedule Memory Optimization?
Over time, Linux-based systems like QTS accumulate cached memory that is no longer actively needed. While the OS reclaims this memory when required, proactively clearing it during off-peak hours — such as 3:00 AM — keeps your NAS running smoothly, especially if you run multiple apps and services simultaneously.
Â
What You Will Need
Â
- A QNAP NAS running QTS 4.4.1 or above
- SSH access enabled on the NAS
- An admin account (or a user with sudo privileges)
Â
Step 1 — Enable SSH and Connect
First, make sure SSH is enabled on your NAS. Go to Control Panel → Network & File Services → Telnet/SSH and enable the SSH service.
By default, only the admin account has SSH access. However, you can grant additional users SSH access from the same screen. Click Edit Access Permission and check the box next to any user you want to allow. Note that while non-admin users can connect via SSH, they will not be able to run crontab commands without sudo or admin privileges — so make sure at least one admin account is enabled.
Then connect from your computer:
Â
ssh admin@YOUR-NAS-IP
Replace YOUR-NAS-IP with the local IP address of your QNAP.
Â
Step 2 — Open the Persistent Crontab File
On QNAP, you must edit /etc/config/crontab directly rather than using crontab -e. This is because the standard crontab gets overwritten on every reboot. Editing the config file ensures your scheduled job survives restarts.
Â
vi /etc/config/crontab
Â
Step 3 — Add the Memory Optimization Job
Navigate to the end of the file, press i to enter insert mode, and add the following line:
Â
0 3 * * * /bin/echo 1 > /proc/sys/vm/drop_caches
This tells the system to run the memory optimization command every day at 3:00 AM. The command writes a 1 to the kernel’s drop_caches interface, which releases unused page cache, dentries, and inodes — exactly what QBoost does when you click Optimize manually.
Press Esc, then type :wq and hit Enter to save and exit.
Â
Step 4 — Reload the Crontab
Run the following command to apply your changes and restart the cron daemon:
Â
crontab /etc/config/crontab && /etc/init.d/crond.sh restart
You will see some output as the daemon restarts. Any SNMP-related warnings can safely be ignored — these are normal on QNAP.
Â
Step 5 — Verify
Confirm your job was added successfully:
Â
crontab -l
You should see your new line at the bottom of the list.
Â
Customizing the Schedule
The cron syntax 0 3 * * * means “every day at 3:00 AM”. You can adjust this to suit your needs:
Â
| Schedule | Cron expression |
|---|---|
| Every day at 3:00 AM | 0 3 * * * |
| Every 6 hours | 0 */6 * * * |
| Every Sunday at 2:00 AM | 0 2 * * 0 |
| Every day at midnight | 0 0 * * * |
Â
Conclusion
By adding a single line to your QNAP crontab, you can automate memory optimization and keep your NAS performing at its best — without ever having to open QBoost manually. As a result, your system benefits from regular memory housekeeping during the quietest hours of the day.
Related Posts
May 30, 2026
Monitor QNAP Updates in Home Assistant
May 28, 2026
Monitor WordPress Updates in Home Assistant
October 20, 2025
NED Energy Dashboard in Home Assistant
October 30, 2024
Bye Bye Homeseer…..Welcome Home Assistant!
November 8, 2019
Monitor road temperatures (country NL only)
September 28, 2019
Shelly Wall Plug-S integration in Homeseer
May 15, 2019
Control a Windows Service from a vb.NET script
December 5, 2018
Monitor your “The Things Network” Gateway
November 4, 2018
ElectroDragon – Wifi IoT Relay Board firmware change to Espeasy
November 3, 2018
Sagemcom-T210D P1 Smartmeter reading in Homeseer
September 2, 2018
Denon HEOS multiroom speaker script integration in Homeseer
August 19, 2018
The Things Network – 8 channel LoRa gateway on Raspberry Pi
May 13, 2018
GPS data from Traccar in Homeseer
March 3, 2018
Google Assistent soon available in Dutch language
March 2, 2018
Fitbit Aria body weight scale
January 22, 2018
Prepare HA system for move
December 31, 2017
Measure traffic duration and distance between multiple addresses
November 11, 2017
Nice Youtube review of the LITEdge smart plug (by skiwithpete)
September 7, 2017
Get Fibaro FGD-212 dimmer working in Homeseer
August 20, 2017
Buienradar (NL) precipitation/rain forecast PHP script
August 2, 2017
From HSTouch to realtime responsive dashboard
July 21, 2017
Uncode: my new WordPress theme
June 13, 2017
BlueIris and Homeseer
May 13, 2017
Garden sprinklers
March 14, 2017
Sonoff GPIO input
March 4, 2017
Amazon Echo Dot voice/speech integration
February 2, 2017
Sonoff firmware tutorial to ESP easy
October 9, 2016
Air quality CO2 monitor
June 11, 2016
Mailbox sensor
June 4, 2016
Fibaro Flood sensor
March 13, 2016
Store Homeseer device parameters into MySQL
February 22, 2016
Control Raspberry Pi relays with Homeseer
February 19, 2016
New IP camera in back garden
February 16, 2016
Retrieve current Spotify track data into Homeseer
February 13, 2016
Control Spotify from Homeseer via Tasker
January 14, 2016
Sensative Z-Wave Plus door/window sensor
October 2, 2015
New GPS tracker TK103-2
October 2, 2015
220V powered Fibaro motion sensor FGMS-001
December 10, 2014
GPS Tracker TK104
November 29, 2014
ClearOne XAP 800 Microphone Mixer
November 15, 2014
Upgrade to Homeseer 3
September 25, 2014






















































