Copy from HD to USB

Status
Not open for further replies.

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
Hi,

I would like to copy a folder from my FreeNAS located at /mnt/hd/public/pictures to my USB drive located at the same FreeNAS box at /mnt/usb/public.
Can this be done in Rsync Task and how? I have rsync enabled is there anything else that needs to be turned on?

Thanks in advance.

Dejan
 
Last edited by a moderator:

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,477
I would just SSH in and use the "cp" or "mv" command (depending on whether you want to copy or move).
 

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
I would just SSH in and use the "cp" or "mv" command (depending on whether you want to copy or move).
If I do that do I need to keep terminal window open while it's copying? I would like to have the FreeNAS do all the work without any other computer being used.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Do it from the console.
 

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
Do it from the console.
Thank you sir.

I assume the command would be cp /mnt/hd/public/pictures /mnt/usb/public correct?
 
Last edited by a moderator:

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,477
I assume the command would be cp /mnt/hd/public/pictures /mnt/usb/public correct?
Maybe, depends on what you are copying. There are multiple "arguments" that you can add to perform certain functions such as copying directories, make the copy recursive, preserving attributes, etc.

You can read about the CP command here:
https://www.computerhope.com/unix/ucp.htm
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Probably need at least a -R in there to get it to copy recursively. For this, I'd probably use rsync:
rsync -av /mnt/hd/public/pictures /mnt/usb/public

It's not clear if you want the pictures in the destination public directory, or want it to create a pictures directory there. I usually add slashes to the ends of the path to make sure a directory is copied and created:
rsync -av /mnt/hd/public/pictures/ /mnt/usb/public/pictures/
 

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
Probably need at least a -R in there to get it to copy recursively. For this, I'd probably use rsync:
rsync -av /mnt/hd/public/pictures /mnt/usb/public

It's not clear if you want the pictures in the destination public directory, or want it to create a pictures directory there. I usually add slashes to the ends of the path to make sure a directory is copied and created:
rsync -av /mnt/hd/public/pictures/ /mnt/usb/public/pictures/

I tried doing a test copy with one movie inside the folder and this is what I'm getting.

[root@freenas ~]# rsync -av /mnt/hd/Public/from /mnt/hd/Public/to
sending incremental file list
from/Gold.2016.mp4
rsync: mkstemp "/mnt/hd/Public/to/from/.Gold.2016.mp4.8QqOJa" failed: Operation not permitted (1)

sent 944,320,986 bytes received 138 bytes 209,849,138.67 bytes/sec
total size is 944,090,357 speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1180) [sender=3.1.2]
[root@freenas ~]#

I can read/write to both folders from my mac no problem.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
It's trying to create a temporary file and failing with "operation not permitted", so it looks like a permission problem. Also, you're trying to copy from one directory on a drive to another directory on the same drive.
 

zemun2

Explorer
Joined
Mar 15, 2017
Messages
72
It's trying to create a temporary file and failing with "operation not permitted", so it looks like a permission problem. Also, you're trying to copy from one directory on a drive to another directory on the same drive.
It worked a lot better when I copied from HD to USB.
Thanks for all the help.

One more question. Is there a way to show progress in percentage or something like that.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Yes!
rsync --progress -av /mnt/hd/public/pictures/ /mnt/usb/public/pictures/
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
rsync --progress -av /mnt/hd/public/pictures/ /mnt/usb/public/pictures/

-a wasn't working on Corral due to some changes in the way directories and files' permissions were set (I remember devs saying they were trying to improve/fix the old Linux way). I had to change around to -rltzu. Will -a work with 11, as it does in 9.10?
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Sorry, I don't know. Depends on what the problem was, but there were some strange permissions things in Corral specific to SMB shares which are not present in 11.
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
Sorry, I don't know. Depends on what the problem was, but there were some strange permissions things in Corral specific to SMB shares which are not present in 11.

Fingers
54856-200.png
 
Status
Not open for further replies.
Top