× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Scheduling file deletion

SR2017
Aspirant

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 days.  How do you do automated tasks ?

 

Model: ReadyNAS RN12G1210v2|ReadyNAS 4200v2
Message 1 of 5
StephenB
Guru

Re: Scheduling file deletion

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.

Message 2 of 5
SR2017
Aspirant

Re: Scheduling file deletion

Thank You StephenB. I have a lot to learn. I'll put this solution in place.
Message 3 of 5
Sandshark
Sensei

Re: Scheduling file deletion

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.

Message 4 of 5
StephenB
Guru

Re: Scheduling file deletion


@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.

Message 5 of 5
Top Contributors
Discussion stats
  • 4 replies
  • 1421 views
  • 0 kudos
  • 3 in conversation
Announcements