Please help with cron hourly

I have following script in /etc/cron.hourly
#!/bin/sh
su -l archie -c "ssh -o TCPKeepAlive=no -o ServerAliveInterval=10 -o ExitOnForwardFailure=yes -n -N -T -R 10002:localhost:22 [email protected]"
It's doing reverse ssh connection to linux.box, problem I have is that when it runs it doesn't go to the background any my cron.hourly job just stays in the process list:
root      1904  0.0  0.2   2776  1188 ?        S    17:01   0:00 /bin/sh /usr/sbin/run-cron /etc/cron.hourly
root      1905  0.0  0.2   2776  1152 ?        S    17:01   0:00 /bin/sh /etc/cron.hourly/reverse_ssh
root      1906  0.0  0.1   2200   864 ?        S    17:01   0:00 su -l archie -c ssh -o TCPKeepAlive=no -o
archie    1907  0.0  0.4   6072  2480 ?        R    17:01   0:00 ssh -o TCPKeepAlive=no -o ServerAliveInterval=10 -o
How do I run reverse_ssh script so that run-cron releases it?
Thanks very much for your help
Regards,
Tomas

1. Doing this:
command &
exit 0
will always be the same as doing this:
command &
2. You could include your entire script in the crontab line. But of course you don't need to.
3. Since you're backgrounding the ssh tunnel (whether using '&' or by using the '-f' flag), cron will see the process _it_ started as having completed. So an hour later, it won't refrain from running the job again (it would refrain if the process it started were still running). So you're going to get repeated attempts to open this tunnel, even if it's already open. I guess they'll fail, since port 10002 on your server is already bound to the existing tunnel. But it may generate lots of error output? Are you having the output of your cron jobs mailed to the local owner of the job (this is the default)?
4. If you wanted to keep the tunnel open all the time, and reopen it when it fails, what you're doing is one way to achieve that. If on the other hand you just want the tunnel open for a short time, you could change your ssh line from
ssh -o TCPKeepAlive=no -o ServerAliveInterval=10 -o ExitOnForwardFailure=yes -n -N -T -R 10002:localhost:22 [email protected] &
to
ssh -o TCPKeepAlive=no -o ServerAliveInterval=10 -o ExitOnForwardFailure=yes -n -f -T -R 10002:localhost:22 [email protected] sleep 10
This replaces the no-command switch "-N" with the command "sleep 10", and uses the "-f" flag instead of "&". It will hold the tunnel open for 10 seconds. If some other process uses the tunnel within 10 seconds, tunnel will continue to stay open until that process (and all other processes) stop using it. You can make the sleep for longer if you like.

Similar Messages

  • HT5824 I switched over from an iPhone to a Samsung Galaxy S3 & I haven't been able to receive any text messages from iPhones. Please help with turning my iMessage completely off..

    I switched over from an iPhone to a Samsung Galaxy S3 & I haven't been able to receive any text messages from iPhones. I have no problem sending the text messages but I'm not receivng any from iPhones at all. It has been about a week now that I'm having this problem. I've already tried fixing it myself and I also went into the sprint store, they tried everything as well. My last option was to contact Apple directly. Please help with turning my iMessage completely off so that I can receive my texts.

    If you registered your iPhone with Apple using a support profile, try going to https://supportprofile.apple.com/MySupportProfile.do and unregistering it.  Also, try changing the password associated with the Apple ID that you were using for iMessage.

  • How can I sync my iPhone on a different computer without erasing my applications? My iPhone was earlier synced with a PC which I don't use anymore. Please help with proper steps, if any.

    How can I sync my iPhone on a different computer without erasing my applications? My iPhone was earlier synced with a PC which I don't use anymore.
    On the new computer, I am getting a message that my all purchases would be deleted if I sync it with new iTunes library.
    Please help with proper steps, if any.

    Also see... these 2 Links...
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141

  • Please help with "You can't open the application NovamediaDiskSupressor because PowerPC applications are no longer supported." I have seen other responses on this but am not a techie and would not know how to start with that solution.

    Please help with the message I am receving on startup ""You can't open the application NovamediaDiskSupressor because PowerPC applications are no longer supported."
    I have read some of the replies in the Apple Support Communities, but as I am no techie, I would have no idea how I would implement that solution.
    Please help with what I need to type, how, where, etc.
    Many thanks
    AppleSueIn HunterCreek

    I am afraid there is no solution.
    PowerPC refers to the processing chip used by Apple before they transferred to Intel chips. They are very different, and applications written only for PPC Macs cannot work on a Mac running Lion.
    You could contact the developers to see if they have an updated version in the pipeline.

  • Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be ab

    Hi, please help with the installation of Lightroom 4, I bought a new Mac (Apple) and I want to install a software that I have on the album cd. My new computer does not have the drives. Can I download software from Adobe? Is my license number just to be able to download the srtony adobe.

    Adobe - Lightroom : For Macintosh
    Hal

  • [ETL]Could you please help with a problem accessing UML stereotype attributes ?

    Hi all,
    Could you please help with a problem accessing UML stereotype attributes and their values ?
    Here is the description :
    -I created a UML model with Papyrus tool and I applied MARTE profile to this UML model.
    -Then, I applied <<PaStep>> stereotype to an AcceptEventAction ( which is one of the element that I created in this model ), and set the extOpDemand property of the stereotype to 2.7 with Papyrus.
    -Now In the ETL file, I can find the stereotype property of extOpDemand as follows :
    s.attribute.selectOne(a|a.name="extOpDemand") , where s is a variable of type Stereotype.
    -However I can't access the value 2.7 of the extOpDemand attribute of the <<PaStep>> Stereotype. How do I do that ?
    Please help
    Thank you

    Hi Dimitris,
    Thank you , a minimal example is provided now.
    Version of the Epsilon that I am using is : ( Epsilon Core 1.2.0.201408251031 org.eclipse.epsilon.core.feature.feature.group Eclipse.org)
    Instructions for reproducing the problem :
    1-Run the uml2etl.etl transformation with the supplied launch configuration.
    2-Open lqn.model.
    There are two folders inside MinimalExample folder, the one which is called MinimalExample has 4 files, model.uml , lqn.model, uml2lqn.etl and MinimalExampleTransformation.launch.
    The other folder which is LQN has four files. (.project),LQN.emf,LQN.ecore and untitled.model which is an example model conforming to the LQN metamodel to see how the model looks like.
    Thank you
    Mana

  • Want a complete migration guide to upgrade 11.1.0.7 to 11.2.0.3 database using DBUA..We are implementing R12.1.3 version and then have to migrate the default 11gR1 database to 11.2.0.3 version. Please help with some step by step docs

    Want a complete migration guide to upgrade 11.1.0.7 to 11.2.0.3 database using DBUA..We are implementing R12.1.3 version and then have to migrate the default 11gR1 database to 11.2.0.3 version. Please help with some step by step docs

    Upgrade to 11.2.0.3 -- Interoperability Notes Oracle EBS R12 with Oracle Database 11gR2 (11.2.0.3) (Doc ID 1585578.1)
    Upgrade to 11.2.0.4 (latest 11gR2 patchset certified with R12) -- Interoperability Notes EBS 12.0 and 12.1 with Database 11gR2 (Doc ID 1058763.1)
    Thanks,
    Hussein

  • Welcome. At the outset, I'm sorry for my English :) Please help with configuration Photoshop CS6 appearance. How to disable the background of the program so you can see the desktop. (same menus and tools) Chiałbym to be the same effect as CS5.

    Welcome.
    At the outset, I'm sorry for my English
    Please help with configuration Photoshop CS6 appearance.
    How to disable the background of the program so you can see the desktop. (same menus and tools)
    i wantto be the same effect as CS5.

    Please try turning off
    Window > Application Frame

  • HT201210 cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    cont contact apple server error please help with ipad touch 4. im just fed up with apple please help me because why is it only apple with these kind of problems?

    If you mean updae server
    Update Server
    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - For one user uninstalling/reinstalling iTunes resolved the problem
    - Try on another computer/network
    - Wait if it is an Apple problem
    Otherwise what server are you talking about

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

  • Please help with slideshow problems!

    Am using Photoshop Elements 8 and trying to make a slideshow. Have tried 4 times now and keep ending up with same problem, cannot reopen project to continue edititing.  Won't show up in orginizer and when I find on harddrive and try to open get message " wmv file cannot be opened".  How can I save a
    slideshow inprogress and be able to reopen and continue to edit and make slideshow?  I want to thank anyone who can help me with this in advance as I
    have gotten so frustrated that I want to just scream.
    Thanks

    Thanks for the help, thought I had done so but maybe not.  Anyway will have another go at it, now may I ask another
    question?  I am trying to add audio to slideshow.  I have some music I purchased thru amazon as mp3 files but I get
    message no codec and when I try to add wmv I get same message.  What type of file do I need and how can I add
    multiple songs to one slideshow.   I have one little wmv file that will go in, but it just replicates itself multiple times until
    it fills slide show. 
    Thanks again, sorry to be a bother, but this thing is driving this old man crazy.
    Date: Sun, 26 Dec 2010 20:34:32 -0700
    From: [email protected]
    To: [email protected]
    Subject: Please help with slideshow problems!
    You need to save the slideshow project in order to be able to go back later and make changes or additions to an existing slideshow . The wmv file is a final output format.
    Now you are most probably using only the Output command: that is what makes the wmv file.
    You should also do the Save Project command. (and I make it a practice to do the Save Project command before I do the Output command).
    If you look at the Elements Organizer 8 Help, there is a topic on "Create a slide show".
    -- Very close to the beginning of that topic is a screen shot of the Sldie Show Editor screen,
    -- The bar below the usual menu bar is labeled with a "B" and called the Shortcuts bar.
    -- The 1st entry on that Shortcuts bar is "Save Project"
    It is the Save Project command that saves the information about which photos, audio, etc you placed in that specific slide show so that you can come back again to do subsequent editing.  Save each Project with a unique name.
    After completing the Save Project command, you shoud see an "icon" in the Organizer for that slide show.
    Note:  you must also keep the photo files and audio files which you have used in this slide show: you can't delete them because the project file does NOT contain a copy of the photos, it only has the identification and folder location of the photo and audio files.
    >

  • Hi. I have an iPhone 4s. The music doesn't play when I connect it to my car stereo. It used to play previously but stopped playing all of a sudden. My phone is getting charged when I cut it to the USB port. Please help with this. The iOS is 6.1.3.

    Hi. I have an iPhone 4s. The music doesn't play when I connect it to my car stereo. It used to play previously but stopped playing all of a sudden. My phone is getting charged when I cut it to the USB port. Please help with this. The iOS is 6.1.3.

    Hello Priyanks,
    I found an article with steps you can take to troubleshoot issues with an iPhone not connecting to your car stereo:
    iOS: Troubleshooting car stereo connections
    http://support.apple.com/kb/TS3581
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • My "fn" button is stuck on only revealing mission control in Lion. With this problem none of my "f" keys will work nor can I hold "fn" and delete to delete text in opposite direction. Can someone please help with this?

    My "fn" button is stuck on only revealing mission control in Lion. With this problem none of my "f" keys will work nor can I hold "fn" and delete to delete text in opposite direction. Can someone please help with this?

    Following the fix here worked for me:
    https://discussions.apple.com/message/15680566#15680566
    except my plist file was in ~/Library instead of /Library.
    -Scott

  • Ipod Nano 6th generation setting issue - hi, when i am listening music and the screen goes to sleep my music stop playing.Please help with settings

    hi, when i am listening music and the screen goes to sleep my music stop playing.Please help with settings

    No problem.   And no worries, several people have made this same mistake!
    Either way enjoy the iPod!
    Brock

  • Please help with Contribute issue- Adobe or anyone!

    My issues are many- I don't know where to start. First, as a long-time Adobe customer, I can not believe how support has declined- I really miss my "support package" from the early 90's when I spoke with a person who really knew how to address my problems and/or questions. I am so tired of being outsourced to someone who has no idea how to address my problem- only to send me to "Document #8932023912 03" off of the Adobe website. I want to talk to someone who KNOWS and APPRECIATES this product, and who understands its internal behavior (like what I get when I call MAC SUPPORT). I will pay for it! I have invested thousands of dollars on Adobe software and am now at an unacceptable standstill.
    My small business relies on the Adobe Creative Suite 4 and the Contribute program. Up until now, I have never had a complaint, especially after moving to Mac a few years ago. Troubles started after two things (still not sure what the culprit was) - installing Snow Leopard and installing a Wacom Bamboo tablet (on the same day- my bad). Well, Illustrator, Photoshop work just fine as well as my other non-Adobe programs. But I can't even open InDesign (will post this on the proper post) or Contribute. So Apple had me deduce that I needed to create a new User and try things there. I eventually migrated to this new user but still, I cannot use Contribute.
    I have set permissions with the program and contents of the folder- in addition to my Contribute keys to no avail. I can't even open it. Nor can I open it in my Root user which at least lets me run In Design. I am at a total loss and I need to update a website for my client. PLEASE someone, I would so greatly appreciate any advice or instruction as to how to run Contribute on my new user. Or in my Root user. I just need to get it to open! Reinstall did nothing PLEASE HELP.
    A special note to anyone from Adobe: I want to talk to someone via a support package-- NOT outsourced. Does this fee-based option exist? It doesn't seem to from the main support number. If someone can help direct me, I would appreciate the proper instruction to do so. I need to get my InDesign running again and I have already invested multiple hours, days with Adobe support with NO solution at all. This is unacceptable in my mind, especially for the moneys invested.
    Thank you in advance... Aimee M.

    I totally share your views on Adobe period. I loved Macromedia., they also answered all my questions, then Adobe had to buy them out! I called them today (sales Dept., that's where they answer rather quickly., of course), they explained the following: You can pay for a live person, but the prices differ  in that they come in packages. In other words, you can pay a flat rate per hour for one-on-one OR pay for one-on-one tech support 5 times per month, and the amount of times per month vary from that point on., and so does the price!  I'm baffled! They are HORRIBLE!! . Like yourself, am on a standstill ever since I've been stuck with not being able to publish my site with current edits and it gives me a message whereas my own company name is "currently editing the page," so it keeps kicking out. I've tried everything, including but not limited to the following: going to the library and checking out books to troubleshoot; going on Adobe pages for support as well the Help features on the software program., etc...I'm exhausted!  ADOBE you guys need to reassess your Customer Care Support and your outsourcing business as well!!! YOU WILL LOOSE YOUR CUSTOMERS RATHER QUICKLY!!

Maybe you are looking for

  • IPhoto 09/Aperture 2 versus iPhoto 09/Adobe Lightroom 2

    Does any one have any recommendations on which combination works best?

  • How do I export a final cut express movie in both PAL & NTSC formats?

    I am wanting to provide both a NTSC and PAL verion of a movie onto a DVD, how can I do this using final cut express?

  • New T-code For GL posting(F110)

    Hello All, There is a Tcode F110 for Payment proposals (Accounts Receivables, Accounts Payable, Treasury modules) for old GL posting. Now SAP had introduce a new T-Code for NEW GL (General Ledger) posting. Can any one Tell me the New T-code. It's Ver

  • Can't find mysterious message

    I've read every email and every missed call and yet there is still an icon showing that I have 1 message. I can't figure out where/what this message is. My SMS is separate and has a different icon so I know it's not that. Anybody have any idea? Thank

  • EXIF time altered on conversion from PEF to DNG

    Converting Pentax PEF files from my *istDS to DNG using the Adobe DNG converter (4.1) results in the EXIF date/times all being shifted forward by six hours. I gather that the camera and the converter are miscommunicating regarding time zone. But the