Move files older then xxDays to other share

Status
Not open for further replies.

Hoaxr

Cadet
Joined
Nov 3, 2016
Messages
1
Hello,

We have 1000 of files and folders on 1 share.
We want to move files older then xxDays to another share, keep the map structure intact and if there are files newer then those xxDays leave them on the share.

Is this possible with a sheduled task?

Something like this that we use to delete files older then 30 days in 1 folder.
find "/mnt/Primair/scans" -type f -mtime +30 -exec rm -f '{}' \;
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Sure, you just have to write a shell script that does what you want.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Hello,

We have 1000 of files and folders on 1 share.
We want to move files older then xxDays to another share, keep the map structure intact and if there are files newer then those xxDays leave them on the share.

Is this possible with a sheduled task?

Something like this that we use to delete files older then 30 days in 1 folder.
find "/mnt/Primair/scans" -type f -mtime +30 -exec rm -f '{}' \;
I'll give a little more information than my friend did.

Write your shell script (or whatever---C program, doesn't matter what), and in the GUI, set it to run under the TASKS->CRON JOBS tab. Be sure to use fully delimited, full-path filenames for everything.
 
Status
Not open for further replies.
Top