LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-31-2011, 03:10 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 237

Rep: Reputation: 30
cron entry via remote ssh


I want to push a line/entry in cron file (via remote ssh) to execute a script(one time) after 30 second of ssh login/exit.

and it must be deleted(cron line) after running the script automatically .

any guidance is appreciated .
 
Old 10-31-2011, 03:47 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
For one-shot scripts a better tool is the at scheduler (provided the at daemon is active on the remote machine). You can do:
Code:
$ at now + 1 minute
at> your_command_here
at> <Ctrl-D>
Anyway, both at and cron have a time granularity of 1 minute, this means you cannot execute something automatically just after 30 seconds you logged-in. Please, can you provide some more details about what you're trying to achieve?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron entry not working as expected td3201 Linux - General 2 07-25-2010 01:07 PM
SSH remote backup fail on cron job - keychain eyt Linux - General 4 07-17-2007 11:17 PM
will this cron entry do what I want it to? microsoft/linux Debian 4 01-12-2006 07:29 PM
Cron Entry tor updatedb? Snump Mandriva 3 10-02-2004 06:37 AM
how to make a cron entry? (perl) akaash Programming 2 05-06-2004 03:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration