What's new

amtm amtm - the Asuswrt-Merlin Terminal Menu

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Share with us!

You will need to install rsync (make sure you have entware installed as well.

From a ssh shell run

Code:
opkg install rsync

I then have this script in /jffs/scripts. Called ImageUSB

Code:
#!/bin/sh

if [ ! -d /tmp/mnt/WDCloud ]
then
    mkdir /tmp/mnt/WDCloud
    chmod 777 /tmp/mnt/WDCloud
fi

mount -t cifs \\\\192.168.0.14\\Router /tmp/mnt/WDCloud -o "username=router,password=password"
sleep 10
if [ -n "`mount | grep /tmp/mnt/WDCloud`" ]; then
    rsync -r -q -u -s --exclude 'myswap.swp' /tmp/mnt/Router/* /tmp/mnt/WDCloud/USBKey/
    rsync -r -q -u -s /jffs/* /tmp/mnt/WDCloud/jffs/
    umount /tmp/mnt/WDCloud
fi

Lastly, in your /jffs/scripts/init-start script, add

Code:
cru a SyncUsbToNas "0 3 * * * /jffs/scripts/ImageUSB"

You will need to modify things for your environment as well as having the proper account on your NAS or where ever you are sending the backup. I had said that the script runs at midnight, but looking at the cron job add line, it runs at 3 am everyday.
 
Hi, sorry for the newbie questions, but I am interested in learning more about amtm and the other scripts it gives access to. I have searched, but cannot answer my questions.

1) Can someone direct me to an introduction for accessing amtm in Asuswrt-Merlin 384.15? I understand I will need to use some kind of terminal?

2) Also, I have a SanDisk 256GB Ultra Fit USB 3.1 Flash Drive. I want to connect it to my RT-AC86U for experimenting with stuff. What file system should it be formatted to?

Thanks!

1) From the link in my signature below. Just remember that you don't need to install amtm in RMerlin 384.15_0 or higher. ;)

amtm Step-by-Step
https://www.snbforums.com/threads/amtm-step-by-step-install-guide-l-ld.56237/#post-483421


2)
From the same link posted above, using amtm to format the drive, Ext4 w/journaling and create a 2GB swap file before installing Diversion which will also (properly) install Entware and pixelserv-tls too. Now, explore as you wish (even if you disable Diversion while doing so).

HTH. :)
 
1) From the link in my signature below. Just remember that you don't need to install amtm in RMerlin 384.15_0 or higher. ;)

amtm Step-by-Step
https://www.snbforums.com/threads/amtm-step-by-step-install-guide-l-ld.56237/#post-483421

2)
From the same link posted above, using amtm to format the drive, Ext4 w/journaling and create a 2GB swap file before installing Diversion which will also (properly) install Entware and pixelserv-tls too. Now, explore as you wish (even if you disable Diversion while doing so).

HTH. :)
ah the ol' @L&LD guides for success.
 
You will need to install rsync (make sure you have entware installed as well.

From a ssh shell run

Code:
opkg install rsync

I then have this script in /jffs/scripts. Called ImageUSB

Code:
#!/bin/sh

if [ ! -d /tmp/mnt/WDCloud ]
then
    mkdir /tmp/mnt/WDCloud
    chmod 777 /tmp/mnt/WDCloud
fi

mount -t cifs \\\\192.168.0.14\\Router /tmp/mnt/WDCloud -o "username=router,password=password"
sleep 10
if [ -n "`mount | grep /tmp/mnt/WDCloud`" ]; then
    rsync -r -q -u -s --exclude 'myswap.swp' /tmp/mnt/Router/* /tmp/mnt/WDCloud/USBKey/
    rsync -r -q -u -s /jffs/* /tmp/mnt/WDCloud/jffs/
    umount /tmp/mnt/WDCloud
fi

Lastly, in your /jffs/scripts/init-start script, add

Code:
cru a SyncUsbToNas "0 3 * * * /jffs/scripts/ImageUSB"

You will need to modify things for your environment as well as having the proper account on your NAS or where ever you are sending the backup. I had said that the script runs at midnight, but looking at the cron job add line, it runs at 3 am everyday.
Thanks for the excellent idea! In looking at your ImageUSB script, I believe that I was able to simplify it significantly. Here is the updated script:
Code:
#!/bin/sh

rsync -a --exclude 'myswap.swp' --password-file=rsync_pass /tmp/mnt/USBLABEL/ USERNAME@192.168.0.14::NetBackup/USBLABEL/
rsync -a                        --password-file=rsync_pass /jffs/             USERNAME@192.168.0.14::NetBackup/jffs/
No mounts are needed...
  1. USBLABEL is USB drive label/mount point.
  2. USERNAME is NAS username for rsync.
  3. Password for USERNAME is placed in /jffs/scripts/rsync_pass with chmod 600.
 
Last edited:
Thanks for the excellent idea! In looking at your ImageUSB script, I believe that I was able to simplify it significantly. Here is the updated script:
Code:
#!/bin/sh

rsync -a --exclude 'myswap.swp' --password-file=rsync_pass /tmp/mnt/USBLABEL/ USERNAME@192.168.0.14::NetBackup/USBLABEL/
rsync -a                        --password-file=rsync_pass /jffs/             USERNAME@192.168.0.14::NetBackup/jffs/
No mounts are needed...
  1. USBLABEL is USB drive label/mount point.
  2. USERNAME is NAS username for rsync.
  3. Password for USERNAME is placed in rsync_pass with chmod 600.
@ERROR: auth failed on module home
rsync error: error starting client-server protocol (code 5) at main.c(1657) [sender=3.1.3]
@
 
@ERROR: auth failed on module home
rsync error: error starting client-server protocol (code 5) at main.c(1657) [sender=3.1.3]
@

Using the :: in the rsync command line requires a module to be given (send the rsync command to a deamon). The syntex would then be rsync ... name@host::<module>\addr

<module> doesn't represent the name of a directory on the remote machine, but the name of a resource, or module in the rsync terminology, configured by the administrator, and made accessible via the rsync daemon. The module can point to whatever path on the filesystem. I have no idea what that is, or if available on Merlin. Note that the --password_file needs rsync used in this mode.

What version of software are you using. 384.14 was missing the cifs component. Guessing this is without saying, but 192.168.0.14 is where my NAS is. You will need to change this address to your NAS.

Outside of that, I am a super novice on the rsync command, so I am not much help there.
 
Last edited:
I have a script set up to run at midnight that copies my entire USB key and JFFS drives to my NAS using rync.
Thank you for the suggestion and the script. I will take a look.
If you rysnc every night, don't you take the risk a corrupted USB stick will be propagated the error to your backup?
 
Thank you for the suggestion and the script. I will take a look.
If you rysnc every night, don't you take the risk a corrupted USB stick will be propagated the error to your backup?

Yep, it is a valid point. Besides the nightly back up of the entire USB key and JFFS directory, I also do daily backups of key information files that I want a history of.

In addition, I backup all my final important scripts and all my OpenVPN server keys to another network location on a one time basis. Anything else really is not important if I loose it. Still, now you have challenged me, I don't think it would be difficult to modify the script to create a unique directory name per night. The number of backups might get unmanageable after a while. But, it will give me something to do while trapped at home :)
 
@thelonelycoder

Trying to update the AMTM:

Code:
 amtm 3.1.5 FW             by thelonelycoder
 RT-AC3100 (armv7l) FW-384.16 @ 192.168.1.1
    The Asuswrt-Merlin Terminal Menu

 3  open     FreshJR QOS                 v8.8

 5  open     scribe                    v2.4.2

 8  open     nsrum                    v30.3.0

 j2 open     ntpMerlin                 v2.3.1
 j3 open     scMerlin                  v1.0.5

 j4 open     spdMerlin                 v3.3.1
 j6 open     uiScribe                  v1.2.1

 ep manage   Entware packages          no upd

 m  menu     amtm   uu  force update  upd err
_____________________________________________

 ! using fallback server diversion.ch
 ! amtm: diversion.ch unreachable

 Update(s) aborted, could not retrieve version
_____________________________________________

 Enter option

Code:
 ping fwupdate.asuswrt-merlin.net
PING fwupdate.asuswrt-merlin.net (104.18.41.167): 56 data bytes
64 bytes from 104.18.41.167: seq=0 ttl=59 time=11.982 ms
64 bytes from 104.18.41.167: seq=1 ttl=59 time=18.022 ms
^C
--- fwupdate.asuswrt-merlin.net ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 11.982/15.002/18.022 ms

Code:
 nslookup fwupdate.asuswrt-merlin.net
Server:    1.1.1.1
Address 1: 1.1.1.1 one.one.one.one

Name:      fwupdate.asuswrt-merlin.net
Address 1: 2606:4700:3037::6812:28a7
Address 2: 104.18.41.167
Address 3: 104.18.40.167

Code:
curl -I http://fwupdate.asuswrt-merlin.net
HTTP/1.1 301 Moved Permanently
Date: Thu, 02 Apr 2020 00:19:41 GMT
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Thu, 02 Apr 2020 01:19:41 GMT
Location: https://fwupdate.asuswrt-merlin.net/
Server: cloudflare
CF-RAY: 57d66137bfdcef12-MIA

Code:
curl https://diversion.ch/amtm_fw/unbound_manager.mod
curl: (60) SSL certificate problem: certificate is not yet valid
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Code:
curl -k https://diversion.ch/amtm_fw/unbound_manager.mod

WORKS GREAT

Is this something temporary???

I was not able to install either!
Code:
 Getting from fwupdate.asuswrt-merlin.net
 ! Module unbound_manager.mod download failed
 ! using fallback server diversion.ch
 ! Module unbound_manager.mod download failed
 
Last edited:
@thelonelycoder

Code:
curl https://diversion.ch/amtm_fw/unbound_manager.mod
curl: (60) SSL certificate problem: certificate is not yet valid
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
"certificate is not yet valid" means your clock is not set correctly.
 
I have run "r" and "uu" more times than I can shake a stick at ... rebooted tried again ... all attempts seemingly ending successfully until I run "u" to check for updates - then get this ...
View attachment 21584

Of course the "r" option removed dc and fd scripts - and after reinstall of dc the fd option does not stick in the amtm menu but can only be seen under option "i" .

I can access Github and diversion.ch without problems - so does not seem to be a DNS issue.

Any ideas ?

Same thing happening to me. Now, after "r" reset AMTM, the fwupdate.asuswrt-merlin.net download fails and diversion.ch download fails. I can access both sites. I was also thinking swap corruption, I could not reset swap through amtm when it was up and cannot rm swap on command line.

Suggestions?
 
@thelonelycoder
Is this something temporary???

I was not able to install either!
Code:
 Getting from fwupdate.asuswrt-merlin.net
 ! Module unbound_manager.mod download failed
 ! using fallback server diversion.ch
 ! Module unbound_manager.mod download failed

Same...
 
"certificate is not yet valid" means your clock is not set correctly.
I uninstalled ntpMerlin and
"ntpd -gq"

all working now!!
 
More...
nslookup diversion.ch and nslookup fwupdate.asuswrt-merlin.net both resolve to 127.0.0.1 localhost.localdomain
can't resolve either
 
More...
nslookup diversion.ch and nslookup fwupdate.asuswrt-merlin.net both resolve to 127.0.0.1 localhost.localdomain
can't resolve either
Your router does not resolve them. Check your WAN settings.
 
Hey. I ssh'ed into my router today...haven't been in since a long time. I went into amtm and looked for updates. It said that there was an update for amtm. I think I was at 3.1.0 and it said 3.1.5 was available...go ahead. New menu quickly starting to display...Ooops!

Now, it keeps redrawing over and over. It gets as far as "ep...manage...Entware packages" and then the menu redraws itself.

I'm trying to look for the script and/or the amtm log, if one exists...still looking. Any help is appreciated.

Update: Found the script. /jffs/scripts/amtm can't find any log...from script, doesn't look like there is one.

Trying to figure out what script is doing. Found the menu entry for entware, which is the line where I believe the issue is occurring. The entware line in the menu isn't displaying the version number.
 
Last edited:
Hey. I ssh'ed into my router today...haven't been in since a long time. I went into amtm and looked for updates. It said that there was an update for amtm. I think I was at 3.1.0 and it said 3.1.5 was available...go ahead. New menu quickly starting to display...Ooops!

Now, it keeps redrawing over and over. It gets as far as "ep...manage...Entware packages" and then the menu redraws itself.

I'm trying to look for the script and/or the amtm log, if one exists...still looking. Any help is appreciated.

Update: Found the script. /jffs/scripts/amtm can't find any log...from script, doesn't look like there is one.

Trying to figure out what script is doing. Found the menu entry for entware, which is the line where I believe the issue is occurring. The entware line in the menu isn't displaying the version number.
Try this:
Code:
rm -f /jffs/scripts/amtm
rm -rf /jffs/addons/amtm
Then run the install command from the website.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top