LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 02:10 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

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, 02:47 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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



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 12:07 PM
SSH remote backup fail on cron job - keychain eyt Linux - General 4 07-17-2007 10:17 PM
will this cron entry do what I want it to? microsoft/linux Debian 4 01-12-2006 06:29 PM
Cron Entry tor updatedb? Snump Mandriva 3 10-02-2004 05:37 AM
how to make a cron entry? (perl) akaash Programming 2 05-06-2004 02:15 AM

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

All times are GMT -5. The time now is 06:17 PM.

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
Open Source Consulting | Domain Registration