SmallNetBuilder Forums
Go Back   SmallNetBuilder Forums > Wireless Networking > ASUS Wireless > Asuswrt-Merlin

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 03-16-2014, 01:28 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 638
Thanks: 142
Thanked 237 Times in 136 Posts
TeHashX is just starting out
Default

Quote:
Originally Posted by brusyev View Post
I am trying to figure out a similar script for my rtn66u but to copy one attached usb drive to another on a daily basis. Both drives are ntfs formated for compatability reasons... I think I first need to make sure that the script first mounts my drives according to their uid's...basically I have two ysb enclosures with raid0 and I would like to mirror one to the other every night....any help with this will be greatly apreciated...
Please give more details, are both drives connected to router through usb ports or only one?
Reply With Quote
  #22  
Old 03-17-2014, 02:20 AM
brusyev brusyev is offline
New Member
 
Join Date: Jul 2013
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
brusyev is just starting out
Default

Correct, I have two usb enclosures connected to two usb ports on the router...please let me know what details are needed and I will provide. I curently have two 1TB drives in one of the enclosures running in raid1. I am hopping to change it to Raid0 to get 2TB and have this enclosure mirrored to another enclosure with the same setup...pleae let me know of the best way to acomplish thus...I may need to create/enable swap space for something as memory intensive as rsync...
Reply With Quote
  #23  
Old 03-17-2014, 04:04 AM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 638
Thanks: 142
Thanked 237 Times in 136 Posts
TeHashX is just starting out
Default

Quote:
Originally Posted by brusyev View Post
Correct, I have two usb enclosures connected to two usb ports on the router...please let me know what details are needed and I will provide. I curently have two 1TB drives in one of the enclosures running in raid1. I am hopping to change it to Raid0 to get 2TB and have this enclosure mirrored to another enclosure with the same setup...pleae let me know of the best way to acomplish thus...I may need to create/enable swap space for something as memory intensive as rsync...
Post "mount" output
Reply With Quote
  #24  
Old 03-17-2014, 11:51 AM
brusyev brusyev is offline
New Member
 
Join Date: Jul 2013
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
brusyev is just starting out
Default

Here is my mount output...


rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw)
devfs on /dev type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sdc1 on /tmp/mnt/MEDIA type ufsd (rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,sparse, force)
/dev/sda1 on /tmp/mnt/CACHE type ufsd (rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,sparse, force)
Reply With Quote
  #25  
Old 03-17-2014, 11:55 AM
brusyev brusyev is offline
New Member
 
Join Date: Jul 2013
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
brusyev is just starting out
Default

The Media drive is the 1TB storage in Raid1 and Cache is the same type of enclosure but currently with a small drive..I will soon upgrade it to 2TB (Raid0) as well...
Reply With Quote
  #26  
Old 03-17-2014, 03:58 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 638
Thanks: 142
Thanked 237 Times in 136 Posts
TeHashX is just starting out
Default

Post "blkid" output please
Reply With Quote
  #27  
Old 03-17-2014, 05:27 PM
brusyev brusyev is offline
New Member
 
Join Date: Jul 2013
Posts: 28
Thanks: 1
Thanked 0 Times in 0 Posts
brusyev is just starting out
Default

/dev/sdc1: LABEL="MEDIA" UUID="EA1E40681E402FBD"
/dev/sda1: LABEL="CACHE" UUID="6C806B1E806AEDD0"
Reply With Quote
  #28  
Old 03-19-2014, 12:13 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 638
Thanks: 142
Thanked 237 Times in 136 Posts
TeHashX is just starting out
Default

First we need to create a pre-mount script (i'm not 100% sure, maybe init-start script, will see after testing)
Code:
#!/bin/sh

mount -t nfsd -o rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force UUID="EA1E40681E402FBD" /tmp/mnt/MEDIA
mount -t nfsd -o rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force UUID="6C806B1E806AEDD0" /tmp/mnt/CACHE
Code:
chmod a+rx /jffs/scripts/pre-mount
Reboot router 2-3 times to see if are mounted as we need, check with "mount" command
Reply With Quote
  #29  
Old 03-19-2014, 04:10 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 638
Thanks: 142
Thanked 237 Times in 136 Posts
TeHashX is just starting out
Default

If is ok, create the following sync-drives.sh script in /jffs/scripts, this will copy all files from CACHE to MEDIA
Code:
#!/bin/sh

rsync -r -l -t -p -g -o -D -h -s /mnt/CACHE/* /mnt/MEDIA
Code:
chmod a+rx /jffs/scripts/sync-drives.sh
If you want to run the script automaticaly every day at 21:00, add this cron job to init-start script
Code:
#!/bin/sh

cru a sync-drives * 21 * * * /jffs/scripts/sync-drives.sh
Code:
chmod a+rx /jffs/scripts/init-start
Code:
reboot
Reply With Quote
  #30  
Old 03-19-2014, 04:31 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 638
Thanks: 142
Thanked 237 Times in 136 Posts
TeHashX is just starting out
Default

Quote:
Originally Posted by TeHashX View Post
First we need to create a pre-mount script (i'm not 100% sure, maybe init-start script, will see after testing)
Code:
#!/bin/sh

mount -t nfsd -o rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force UUID="EA1E40681E402FBD" /tmp/mnt/MEDIA
mount -t nfsd -o rw,nodev,noatime,nls=utf8,fmask=0,dmask=0,force UUID="6C806B1E806AEDD0" /tmp/mnt/CACHE
Code:
chmod a+rx /jffs/scripts/pre-mount
Reboot router 2-3 times to see if are mounted as we need, check with "mount" command
I guess this script is better, just in case http://forums.smallnetbuilder.com/sh...42&postcount=5
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 02:09 PM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  406
john9527  157
azazel1024  116
htismaqe  104
sfx2000  81
stevech  75
ColinTaylor  65
AndreyPopov  57
TonyH  55
bbb0777  42
RMerlin  6059
john9527  389
stevech  351
ryzhov_al  280
TeHashX  237
L&LD  232
RogerSC  201
sinshiva  147
sfx2000  134
joegreat  126
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  28659
Old Brainstorming...  2626
Old Advice on...  2573
Old RT-AC68P...  2356
Old Looking for...  2351
Old RT-AC68U...  1867
Old Asus...  1796
Old Issues...  1764
Old Stable...  1648
Old AC-68...  1608
Old Asuswrt-Merli...  208
Old Advice on...  49
Old Brainstorming...  47
Old Looking for...  35
Old RT-AC68P...  29
Old WiFi...  27
Old Stable...  25
Old Issues...  25
Old WiFi Rates  23
Old RT-AC68U...  22


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2006-2014 Pudai LLC All Rights Reserved.