1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Syncing / transferring files between two routers

Discussion in 'Tomato Firmware' started by HexImaL, Apr 9, 2010.

  1. HexImaL

    HexImaL LI Guru Member

    Hey folks,

    I'm now going mad after two days or wondering how to properly set this up, so I finally decided to ask for help. I have a two router WDS + AP setup, but I want to change the wireless password at certain times during the day. In order to do that, I have to sync the newly generated password between both routers (suggestions on other syncing methods welcome).

    I've decided to use scp - I've put the public key in one router and then use "scp -i private.key local_file user@host:remote_file" to put the file.* Executing this script manually works great. When I use a cron job however, I get "cron.err"**. I also have the same problem with ftpput, since I also want to upload the new key to an ftp server (i.e. manually executing works, cron doesn't)

    Which user is cron using? Isn't it root? What could be the problem?

    Thanks to all the pro's in this forum, in advance!

    *There is another problem related to this. Upon each reboot, I have to confirm the fingerprint before the initial scp connection. Maybe I should just copy a backed up versions of the authorized_hosts file?

    ** Here's the line in the log:
    Apr 9 02:15:01 ApartmentRouter cron.err crond[272]: USER root pid 440 cmd /jffs/uploadpass.sh
  2. HexImaL

    HexImaL LI Guru Member

    Fixed, I didn't include the full path to the files.

    For anyone reading this topic, fingerprint confirmation on first connection to the other router can be bypassed by backing up the known_hosts file (not as I previously stated authorized_hosts), after a successful connection. Then put this in Init, so it is copied on each reboot:

    sleep 15
    cp /jffs/known_hosts /home/root/.ssh/known_hosts

    without "sleep 15" the command is not successful, since the /jffs partition is not yet mounted.

Share This Page