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, 02:28 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 676
Thanks: 150
Thanked 253 Times in 150 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, 03: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, 05:04 AM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 676
Thanks: 150
Thanked 253 Times in 150 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, 12:51 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

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, 12:55 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

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, 04:58 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 676
Thanks: 150
Thanked 253 Times in 150 Posts
TeHashX is just starting out
Default

Post "blkid" output please
Reply With Quote
  #27  
Old 03-17-2014, 06: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, 01:13 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 676
Thanks: 150
Thanked 253 Times in 150 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, 05:10 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 676
Thanks: 150
Thanked 253 Times in 150 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, 05:31 PM
TeHashX's Avatar
TeHashX TeHashX is offline
Very Senior Member
 
Join Date: Jul 2012
Location: Europe
Posts: 676
Thanks: 150
Thanked 253 Times in 150 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 10:14 AM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  389
azazel1024  130
L&LD  111
john9527  99
htismaqe  96
stevech  79
ColinTaylor  76
hggomes  54
sfx2000  51
Anzaia  47
RMerlin  6292
john9527  461
stevech  353
ryzhov_al  289
TeHashX  253
L&LD  243
RogerSC  203
sinshiva  146
sfx2000  136
joegreat  127
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  57410
Old RT-AC68 -...  25135
Old Moderate Nat...  5447
Old ASUS RT-N66U...  4970
Old iOS 8.1...  4225
Old RT-AC87U -...  2782
Old RT-AC68P QOS...  2276
Old New AC68...  2209
Old AC68U,...  2099
Old Ruckus...  1907
Old Asuswrt-Merli...  253
Old RT-AC68 -...  141
Old Review: 24...  35
Old Moderate Nat...  34
Old iOS 8.1...  33
Old RT-AC87U -...  26
Old RT-AC68P QOS...  24
Old How to flash...  24
Old Help Plz:...  21
Old Linksys...  21


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