USB to NAS Transferring...

Discussion in 'Tomato Firmware' started by Retronite, Jul 7, 2014.

  1. Retronite

    Retronite Networkin' Nut Member

    Not sure if this has already been asked as I was unable to find an answer through the threads.

    I would like to transfer data from a USB storage device connected to my TomatoUSB router to my Ethernet storage device which is also connected to the same router but doing so via a script on the routers custom script section.

    I am currently running Shibby's tomato-K26USB-1.28.RT-N5x-MIPSR2-120-RT-N53.

    I am trying to avoid using a PC/mobile device to perform the data transfers.

    Thanks in advance! :)
  2. remlei

    remlei Networkin' Nut Member

    assuming your NAS has Windows Shares/SAMBA enabled.

    Configure your router to connect to cifs from a samba share.
    after that you can use the cp command to copy files from usb storage to cifs storage.
  3. Monk E. Boy

    Monk E. Boy Network Guru Member

    Indeed, if you mount a CIFS (AKA Samba) share on the router, then on the router you can copy files all day long between anything mounted on the router itself. You'll need to be familiar with Linux copying, but it's not too complicated.

    Assuming you want to do it on a timed basis and not just when the router reboots, you'll probably want to copy using scheduler. You can do it under scripts but then you have to sort through cron in order to add the copy to cron and that's a lot of work for a simple timed copy. Scheduler has its detractors but it works most of the time (at least in my experience), and it's fairly simple to use.

    You may want to create a shell script either on the USB drive or on the CIFS share and call that script via scheduler to make it easier to modify going forward. Then you don't have to modify the scheduler command to change anything, you just edit the shell script (its just a text file) and the next time it runs, voila, the new script runs instead of the old one.
  4. Retronite

    Retronite Networkin' Nut Member

    Thanks remlei and Monk E. Boy, that's now working perfectly.

    I had enabled a CIFS share under Administration > CIFS Client which needed the NAS address, credentials, etc.

    Then under Tools > Execute System Command screen I used the following command to copy from the mounted USB drive to the CIFS share:-
    cp -R /tmp/mnt/KINGSTON/Photos/* /cifs1/Shared\ Photos
    NB: Directory names with a space in them will need a \ for the system to recognise it.

    I need to brush up on my Linux commands. :oops:

    My next task is to transpire this to a press of the WPS Button. :confused:
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice