Moving Files

Status
Not open for further replies.

George51

Contributor
Joined
Feb 4, 2014
Messages
126
I have a folder synced with btsync on FreeNAS, I put movies into this folder (from any different machine attached to the btsync) and that will sync to FreeNAS fine.

I would like to periodically move all those films into my media folder with Plex so that plex can access them (hence removing them from the btsync folder and freeing up the space again on the other machines)

My assumption is to us 'mv' in a cron job?

Would this work? something like?

mv /mnt/Tank/User/Movie/ /mnt/Tank/Media/Movie/

Although by googling around I am under the impression you only move files you are currently in the directory of?
Any help would be appreciated
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I think that should work fine. Note that depending on circumstances, FreeBSD will either have 'mv' rename the files and folders or 'cp -pRP' the source file(s) and then rm -rf the source directories.
This behavior depends on whether you are moving them within the same dataset or to a new dataset. In the latter case, it may be a good idea to have the cronjob happen when you are not actively using the server (depending on how many files you are dealing with). For reference see https://www.freebsd.org/cgi/man.cgi?format=html&query=mv(1)
 
Status
Not open for further replies.
Top