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: 564
Thanks: 133
Thanked 212 Times in 119 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: 25
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: 564
Thanks: 133
Thanked 212 Times in 119 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: 25
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: 25
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: 564
Thanks: 133
Thanked 212 Times in 119 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: 25
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: 564
Thanks: 133
Thanked 212 Times in 119 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: 564
Thanks: 133
Thanked 212 Times in 119 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: 564
Thanks: 133
Thanked 212 Times in 119 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 06:53 PM.


Top 10 Stats
Top Posters* Top Thanked
RMerlin  411
sm00thpapa  209
stevech  191
azazel1024  179
KGB7  153
jim769  87
philmiami  85
AcostaJA  73
htismaqe  71
microchip  66
RMerlin  5150
stevech  315
ryzhov_al  259
TeHashX  212
RogerSC  187
L&LD  186
joegreat  123
jlake  122
sinshiva  115
sfx2000  112
Most Viewed Threads* Hottest Threads*
Old Asuswrt-Merli...  19144
Old Switched...  8926
Old NEW RT-AC68R...  8131
Old ASUS...  7406
Old 3.0.0.4.376.1...  7059
Old ASUS...  6135
Old ASUS RT-AC87...  4134
Old ASUS RTAC68U...  3983
Old Netgear...  3746
Old ASUS...  3708
Old Asuswrt-Merli...  188
Old ASUS...  83
Old Switched...  66
Old NEW RT-AC68R...  57
Old [Q] How to...  55
Old Overclock...  52
Old N66U daily...  47
Old ASUS...  45
Old How many of...  45
Old ASUS...  44


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