NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
SR2017
Nov 24, 2017Aspirant
Scheduling file deletion
Absolute beginner with no NAS experience. I have a sql maintenance plan backing up data from the sql server to a share on the NAS. I need to create a clean up routine to delete files older than 3 ...
StephenB
Nov 24, 2017Guru - Experienced User
There's no way to automate file deletion.
What you can do is schedule a daily backup - either use incremental rsync (set to delete files not on the source) or another protocol (full backup, set to delete all files in the destination share). Either way will work, incremental rsync is more efficient.
Then set up custom snapshots on the share with three days retention.
The result will be that the main share will have just the most recent backup, but you can still get back the previous day's backups by restoring the snapshots.
SR2017
Nov 24, 2017Aspirant
Thank You StephenB. I have a lot to learn. I'll put this solution in place.
- SandsharkNov 25, 2017Sensei
It certainly should be possible to set up a cron job that uses the find command to delete files older than some amount, but that can't be done via the GUI and is not somethng I'd recommend a beginner try his hand at. A robocopy command on a Windows machine would be yet another way to do it. Using an rsync copy is the most straightforward method do-able via the GUI and strictly running on the NAS.
- StephenBNov 25, 2017Guru - Experienced User
Sandshark wrote:
It certainly should be possible to set up a cron job that uses the find command to delete files older than some amount, but that can't be done via the GUI and is not somethng I'd recommend a beginner try his hand at.
I agree, it can be done that way but probably isn't best for a beginner to start with ssh.
Sandshark wrote:
A robocopy command on a Windows machine would be yet another way to do it.
Yes, and if the server is a windows machine, that is a reasonable way to do it.
Sandshark wrote:
Using an rsync copy is the most straightforward method do-able via the GUI and strictly running on the NAS.
Either using snapshot retention to save the previous 3 days, or by daisychaining backup jobs (setting up three backup shares, migrating backup2->backup3, backup1->backup2, and then server->backup1). The daisychaining requires some care on the timing, but since an OS 6 NAS will back up from a snapshot it is more robust than with OS 6 than it is on OS 4.2 or OS 5.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!