How to copy/move files locally or over the network without using your computer to do it.

Started by PeterRtx, May 11, 2013, 08:16:50 PM

Previous topic - Next topic

PeterRtx

Since Telnet is not supported by my LS-V3.0TL (and PLEASE correct me if I am wrong on that!) copying or moving files between local shares on a single NAS, external USB drives, or between multipule NAS devices is painful, since using your computer essentially copies the data to your computer's OS and back again. If we had telnet, we could issue the commands directly on the NAS itself, which would be far more efficient, reliable and would not tie up your computer in the process. 

 

Lacking access to telnet, there is a way to do this using PHP and the shell_exc() command.

 

So, lets say I have a folder on an external USB dirve that is 500GB of VOB files. I want to copy it on to my NAS drive, but would rather not copy it to my PC first or send the data over the network at all. Since the 

 

 

Steps...

 

1. Turn on the Web Server

 

2. Create a PHP file that issues the desired commands

 

Example: Lets call the file copyfolder.php with the following contents.

 

<html><?php

echo '

';
$returnVar = shell_exec("cp /mnt/usbdisk1/2Burn/ /mnt/disk1/share/targetfolder") ;
echo $returnVar;
echo '
';
?></html>

 

Note: the part in bold is what you would need to change. It is the actual Linux command for copying the 2Burn folder from an attached USB drive to the NAS share called targetfolder, but doing this way (under Linux cp = copy and mv = move) Plenty of great sites on the Internet to explain them in great detail.

 

3. Open the php file in your browser throught NAS's web server to execute the command

 

Assuming your NAS has an IP of 192.168.0.100, something like the following would work.

 

http://192.168.0.100:81/">http://192.168.0.100:81/copyfolder.php

 

Thats it. Now you can close your browser, turn off your computer and watch the lights flash on the USB drive would it copies and you can go to bed...

 

Note: the above example would still not be all the fast, but still much faster than doing a drag and drop from windows explorer. The only limits now would be the USB 2.0 transfer rate and the drive read/writes.

 

However, if you were moving a folder from one share to another on the same NAS, the effect would be almost instant since to the NAS, they are on the same drive.

 

 

 

 


ESCHER

You can use the backup function to copy directories between shares, even within the same linkstation.  Then you can move the files inside the share easily by simply Windows cut and paste (which efficiently moves, not copies and deletes files).


Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 5: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default), StopForumSpam.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 130 (show)
Files included: 35 - 1354KB. (show)
Memory used: 1001KB.
Tokens: post-login.
Queries used: 15.

[Show Queries]