Get script from server and run it.

Discussion in 'macOS' started by 173080, Nov 5, 2007.

  1. 173080 macrumors 6502

    Aug 15, 2003
    How can I make a mac running 10.5 check an FTP (although scp through ssh would be preferred) server every hour and look for scripts?

    It should be completely transparent to the user.

    If there are scripts, the mac should download and run them locally as root or sudo.

  2. 173080 thread starter macrumors 6502

    Aug 15, 2003
    It would probably be faster to make the client mac attempt to hold an ssh tunnel and redirect ports so I can just use Apple Remote Desktop.

    The problem here is that this computer will be used behind several firewalls and I have no access to the routers, so I need the client to initiate the connection to the server.

    How can I make an SSH tunnel that is transparent to the user? It needs to run as a daemon or some sort of background task. If there is internet and it can connect, good. If it can't, it shouldn't set off warnings of any sort as this would just be confusing. It should also run even if the user isn't logged in.

    So basically what I need is to know how to make an ssh tunnel every hour or so if there isn't one up already in 10.5.
  3. roblogic macrumors newbie

    Jun 30, 2007
    Write a shell script to grab the files with scp and run it from cron?
  4. 173080 thread starter macrumors 6502

    Aug 15, 2003
    Does cron work the same way in 10.5 and 10.4?

    If I make a cron job that starts an ssh tunnel, what will happen once the tunnel is already up?

Share This Page