Cron Jobs like Something......

Hi,
I have a system in which client connect to server sending username and password the server authenticate the client and check the duration of client left,i have external scrit linux based that disconnect the user the problem is how to execute a script at that specifi time let say after 30 min or i hr etc..
the client and server both written in java.server is running on linux platform.

"man crontab"

Similar Messages

  • Need advice on running timer based cron jobs

    Hi,
    We made a cool desktop product on Flex that runs on the Air environment. After having released it a while ago, we think about taking its performance to the next level by being able to mimic cron job like functionality based on timers.
    However, one of the setbacks for us while we tried to do something similar earlier was the Flash platform's single threaded architecture. So if we are running something resource consuming in the background, chances are that the UI might get stuck if a part of it is being rendered. That will make things looks ugly and we are trying to find ways to make it work.
    Can anyone recommend anything that would help?
    Thanks!
    Vivek

    > 1. What is the best fastest system AE can take advantage of? If we get 6 or 8 or 12 core Mac Pros (instead of the quad core) with more RAM, would AE be able to access that speed, and if so up to how many GB can it use, only up to 2GB per core or can it use more?
    Yes, After Effects will take advantage of multiple fast CPUs and all of the RAM that you can install.
    You also want to have a decent-sized SSD connected over a fast bus for the disk cache. The new Mac Pro does very well in that regard.
    2. Should we replace the graphics card with an Nvidia CUDA? Is the ray-tracing engine something we’ll need with Cinema 4D work?
    The After Effects ray-traced 3D renderer has nothing whatsoever to do with Cinema 4D.
    Do not make any buying decisions based on the  After Effects ray-traced 3D renderer unless you already know for certain that you have a need for it. Since you're asking, it seems that the answer is that you don't.
    See this page for information about hardware for Premiere Pro and After Effects: http://adobe.ly/pRYOuk

  • Need help with a cron job

    What I want to do is run an Applescript every 6 hours and 1 minute. If the computer is asleep when the job comes due, I want it to execute the script and reset the counter. Can crontab do this? If so, how to set it up?

    Gnarlodious wrote:
    Then skip it, I can see there is no easy way.
    I don't think it's that hard, though. Just a bit tricky. I was just a bit confused on what exactly you wanted.
    I could write a stay-open Applescript application, but I wanted to avoid cluttering up the Dock just to run a command every 6 hours.
    Nah, I wouldn't want that either.
    If I were doing something like this and I wanted it to work like this:
    1. Run every six hours, at 6 AM, noon, 6 PM, and midnight.
    2. Run after waking up if the computer has been asleep and missed any of the times in between, say if you let the computer sleep thru the 6 AM job.
    I'd do this:
    1. Call the AppleScript periodically from a cron job. How often would be dependent on how tight you want the times to be to when you wake up.
    2. Have the AppleScript save a text file somewhere with the time when it runs. That way, if your computer is asleep at 6 AM, the script could use this to decide if it missed running while it was asleep.
    3. Have your script check this time and if it's over 6 hours, let the script do its thing. If not, then just exit, to try all this again the next time cron runs it.
    Here's kind of a pseudo-code way of describing it:
    check if it's 6:01, 12:01, 18:01, 00:01
    if yes:
    do your AppleScript business
    save the current time in a file
    exit
    if it's not one of those times:
    check if it's been over 6 hours since the AppleScript did its business
    if yes:
    do the AppleScript business
    save the current time in a file
    exit
    if no:
    exit
    Then you could do two cron jobs:
    1 */6 * * * /path/to/applescript
    */5 * * * * /path/to/applescript
    The first one would run at your appointed times. The second would just run every 5 minutes to catch those times when the computer was asleep. The "5" could also be "10" for every ten minutes. Or whatever you decide you'd like.
    I'd show you an AppleScript, but I'm really not so good at that. If a Perl script would help, I could whip one up pretty quickly, I think.
    charlie

  • Cron job help- Need to run the Autobuddy command every night...

    I have not written anything in the form of a Unix script for YEARS and YEARS. Our XServe was built in Advanced mode, currently running 10.5.4 Server. On this box, we are running Wiki and iChat. Since we built this box as an Advanced box the "Autobuddy" option was not available.
    I have since enabled it at the command line, but I am told by Apple that there still needs to be a command run after every time a user logs in if you want others to Autobuddy. That command is this:
    "sudo /usr/bin/jabber_autobuddy -m"
    Now I think this would be pretty easy to setup as an automatic cron script, but like I said, I have not written something like this in forever. Not to mention, I am not 100% sure what needs to happen since running the script with an sudo command will prompt for the root password.
    I was wondering if anyone would be able to help me write the script up, and give me some instructions on how to install it. I just want it run everyday, midnight is fine, I don't really care. All I know is that we have a dept of 150 people, and it grows and shrinks all the time. They can deal with a new user not being seen for 24-48 hours, I just want to get this automated.
    Any helps would be GREATLY appreciated!
    Thanks
    Tom

    If you want to keep it simple try [CronniX|http://www.abstracture.de/projects-en/cronnix] a graphical tool for setting up CRON jobs on OSX. Whilst I have not actually done an autobuuddy in this way, I cannot see any reason why it will not run as a Cron Job.
    The proper way ideally would be to use the launchd service.
    Something like this should work:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.jabber.dailyautobuddy</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/bin/jabber_autobuddy</string>
    <string>-m</string>
    </array>
    <key>LowPriorityIO</key>
    <true/>
    <key><UserName></key>
    <string>admin</string>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>0</integer>
    <key>Minute</key>
    <integer>05</integer>
    </dict>
    </dict>
    </plist>
    (not sure why, but tabs are not showing up, making this hard to read)
    Message was edited by: Tim Harris

  • Oracle Data Pump (expdp) credentials via cron job

    I have Oracle 10.2 on Linux Red Hat Server. In additions to performing appropriate backups of my database I also have a cron job I use to performa full logical export using expdp every night to export user objects in the event that a singleobjects needs recovered. This is an extra safeguard for object recovery.
    Currently I do my export (expdp) via a cron job run as the oracle software owner as a db user with db credentials specified. I would however like to change this script to essentially run as sys by doing something like "expdp / as sysdba... " However it appears doing so actually requires the password to be supplied and to run expdp as "expdp sys/password as sysdba".
    does anyone have experience performng an expdp as sys without specifying the password... essentially being able to do "/ as sysdba"?
    Hope that makes sense.
    Thanks for any suggestions.

    I appreciate all comments. At the expense of being long winded I did not get into all the details. But to be more clear I want to say
    1. I am using a parfile as to hide the password from the ps command.
    2. I also understand that doing it as sysdba is not recommended but i thought if I did so I could eliminate need for storing clear text password.
    3. This system is on a seperate "air-gapped" (a.k.a "sneaker-net") from the outside world and is a better protected than if sitting somewhere near the internet.
    4. Historically we have not been permitted to use OP$ accounts. This may be a legacy issue,and will (re-)investigate this as an option.
    5. Just to be clear, I really do not want to do a full export as sysdba. In fact currently I am doing it as a user with EXP_FULL_DATABASE role. However, that requires password to be stored in file (parfile). The file has it in clear text which is still not optimal because System Admins could gain access to this password (Yes I know system admins could do larger damage, but we still need to protect the passwords).
    I am going to look at calling the API directly, and OP$ if needed.
    Thanks for the suggestions.

  • How to check why some of the Cron jobs didn't ran at the scheduled time?

    This is my first question ever on the forum. Hope I'm following the format of posting the thread.
    I could find a similar query on the forum but couldn't find the exact answer.
    Versions:
    Oracle: 11.2.02.0
    Linux: Linux xxxxx 2.6.32.12-0.7-default #! SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LINUX
    In our crontab there are lot of scripts that ran at the scheduled time. Around 3 reports didn't ran at the scheduled time today?
    There is no error or some error mail saying that those reports got failed. They just didn't ran at that time.
    How to find out why those jobs didn't ran?
    Is there anything like cron log or something like that to trace it?
    Please guide me. Thanks in advance.

    977789 wrote:
    This is my first question ever on the forum. Hope I'm following the format of posting the thread.
    I could find a similar query on the forum but couldn't find the exact answer.
    Versions:
    Oracle: 11.2.02.0
    Linux: Linux xxxxx 2.6.32.12-0.7-default #! SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/LINUX
    In our crontab there are lot of scripts that ran at the scheduled time. Around 3 reports didn't ran at the scheduled time today?
    There is no error or some error mail saying that those reports got failed. They just didn't ran at that time.
    How to find out why those jobs didn't ran?
    Is there anything like cron log or something like that to trace it?
    Please guide me. Thanks in advance.Since this question has nothing to do with Oracle Databases and everything to do with Linux functions and usage, it would be better asked in the [url https://forums.oracle.com/forums/forum.jspa?forumID=135]Linux Forum
    When posting there, you can save yourself a bit of time by going ahead and showing the line from crontab for a report that "didn't run", and perchance the script itself. Best enclosed in the / tags to preserve formatting.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Pacman -Syu as a CRON job?

    OK, ... before the flames errupt ... I'm not managing any mission-critical systems.
    My interest in 'pacman -Syu' as a CRON job is for personal and friend's systems.  I'm wondering if you could post your cron scripts as an example for me to learn from.  How to you prefer to set your pacman.conf for this sort of thing?
    I'm mostly interested in the security benefits and new-features of using new/current packages by this automation.
    Thanx.

    I higly suggest you to do not run pacman as cronjob, but anyway there is nothing particular to do.
    At first ensure you have crond configured and running.
    Then just go into /etc/
    there are some directory with cron.[something]
    chose with which frequency youw ant to run the cron job
    then just create a file in the appropriate directory
    For pacman it shoul look like
    #!/bin/sh
    pacman -Syu
    I suggest you to use the
    IgnorePkg = <package> [package]
    in pacman config file in wich you specify wich package MUST NOT be update, for instance lilo.
    Consider that and indiscriminate automatic updating can potentially leed to an unsuable system.

  • Cron jobs and crashes

    I have a script that I wrote to backup a server at midnight every night. It uses rsync to perform the backup. The past two nights it has run it seems to cause the server to crash. I used the Terminal to setup a cron job to run the script. Does this sound like a serious error or am I doing something completely wrong, or should it maybe be done at a different time? I looked through the logs and the kernel seems to panic and call crashdump or panicdump.
    The system in question is a Mac Mini if it makes any difference. If anyone would like I could post the script.
    Tom

    Here is the script file. I tried changing the time the script is run from midnight to 1AM and it ran the problem was that it ran about 60 times!!!!
    Is this a problem with the cron job because I see no problems with my script. I can successfully run it from the command line.
    #!/bin/bash
    DIRS=(/Applications /Developer /Groups /Library "/Shared Items" /System /Users /bin /opt /private /sbin /sw /usr)
    ###### DON'T CHANGE BELOW HERE ######
    LOGS_DIR="/Library/Logs/Backup"
    MACHINE=`hostname -s`
    RSYNC_FLAGS=" -avz -e ssh --eahfs --delete" # These shouldn't need changed
    DATE=`date +%m%d%G`
    RSYNC_BIN="/usr/local/bin/rsync"
    if [ ! -d "$LOGS_DIR" ]; then
    mkdir $LOGS_DIR
    fi
    if [ -z "$1" ]; then
    echo "usage: $0 <daily|weekly>"
    exit
    fi
    TYPE=$1
    if [ "$TYPE" = "daily" ]; then
    TYPE="Daily"
    elif [ "$TYPE" = "weekly" ]; then
    TYPE="Weekly"
    else
    echo "Bad Option please use daily or weekly"
    exit
    fi
    BACKUP_DIR="146.186.147.152:/Volumes/Backups_${TYPE}/${MACHINE}/"
    #echo "${RSYNC_BIN} ${RSYNC_FLAGS} "${DIRS[@]}" ${BACKUP_DIR} >& ${LOGS_DIR}/${TYPE}_${DATE}.log"
    #${RSYNC_BIN} ${RSYNC_FLAGS} "${DIRS[@]}" ${BACKUP_DIR} >& ${LOGS_DIR}/${TYPE}_${DATE}.log
    #echo "${RSYNC_BIN} ${RSYNC_FLAGS} "${DIRS[@]}" ${BACKUP_DIR}"
    ${RSYNC_BIN} ${RSYNC_FLAGS} "${DIRS[@]}" ${BACKUP_DIR}

  • [Solved] Setting Up A Cron Job

    I want to set up a cron job that will copy (update) my download folder that contains all my linux related stuff to the linux downloads folder contained in my windows downloads folder. I know how to set up crontab but vi(m) confuses me since it opens crontab as a temp file and I dont know what to call it when I try and save it. I tried using EDITOR=nano crontab -e but it still opens vim
    heres the line I want to input into crontab:
    0 3 * * * cp -Ru /home/bran/downloads/* "/media/mybook/Downloads/Linux Downloads/"
    Last edited by brando56894 (2009-05-05 23:12:05)

    I tried adding the job to /etc/cron.daily but that didnt seem to have any effect on anything, ive been learning vim on and off for awhile now but its alot to learn and its completely different than anything else. I know the basic stuff (save, quit, quit!, startinsert) but thats about it. I think the best feature I love about it is the syntax highlighting since i usually use nano and it doesnt seem to work even when i tried to enable it in the config file.
    brisbin33 wrote:
    hey, that was my bad.  i guess it's a preference that i incorrectly characterized as a best practice.  too much bash scripting makes me aware of when things don't _need_ to be double quoted... doesn't mean they _shouldn't_ be double quoted. 
    getting into that habit of the down slash in front of spaces might come in handy though b/c you would know to also put it in front of symbols like $ and ? which wouldn't behave well inside double quotes.  however, in your case, either way works just fine.
    i'll trade that bit of bum advice for some good advice though: look into rsync, it works very similar to cp except it won't spend all that time/energy copying files that are already there.  does my nightly backup (~205 GB) in less than 3 minutes.
    oh, and don't forget to add [solved] if you get this all working.
    haha its cool, i was actually thinking about using rsync originally but then i was looking up a guide for it and it seemed to complex to do something simple like I needed to do. my linux downloads folder is only about 400 or so mb and the u flag updates only changed files so it doesnt take that long anyway.

  • How to Create Linux-Cron Job  from a Java Program

    Hello,
    Can anybody help me to CREATE/EDIT/DELETE Linux Cron job from Java Program. Its Very Urgent.Thanks in advance..
    from
    Chakri

    I decided this didn't sound too tough so I played around with it a little. Basically because I'd never tried executing external processes out of java before, so I wanted to see how it was done.
    Just change whatever you like in the jobs ArrayList and call writeJobs.
    If you call writeJobs without putting anything in the list first you'll wipe out all of your crontab entries.
    import java.lang.*;
    import java.io.*;
    import java.util.*;
    public class cron {
        ArrayList jobs;
        Runtime rt;
        cron() {
         rt = Runtime.getRuntime();
         jobs = new ArrayList();
        void readCron() {
         String[] list = { "crontab", "-l" };
         jobs = new ArrayList();
         try {
             // Stick a job into crontab
             Process child = rt.exec(list);
             BufferedReader cronout = new BufferedReader(new InputStreamReader(child.getInputStream()));
             String cronjob = cronout.readLine();
             while (cronjob != null) {
              jobs.add(cronjob);
              cronjob = cronout.readLine();
             child.waitFor();
         catch(IOException e) {
             System.err.println("IOException starting process!");
         catch(InterruptedException e) {
             System.err.println("Interrupted waiting for process!");
        void listJobs() {
         Iterator iter = jobs.iterator();
         while (iter.hasNext()) {
             System.out.println((String)iter.next());
        void writeJobs() {
         String[] edit = { "crontab"};
         try {
             // Stick a job into crontab
             Process child = rt.exec(edit);
             PrintWriter cronIn = new PrintWriter(child.getOutputStream());
             Iterator iter = jobs.iterator();
             while (iter.hasNext()) {
              cronIn.println((String)iter.next());
             cronIn.close();
             child.waitFor();
         catch(IOException e) {
             System.err.println("IOException starting process!");
         catch(InterruptedException e) {
             System.err.println("Interrupted waiting for process!");
        void doStuff() {
         readCron();
         listJobs();
         jobs.add("* * * * 4 cronjob");
         writeJobs();
         readCron();
         listJobs();
        public static void main(String[] args) {
         cron c = new cron();
         c.doStuff();
    }

  • DBA scripts run by cron job

    We've got a development database on which we're working every day. We intend to set up a cron job to run about once a week to help in the maintainance & performance of the database.... analyzing tables, stuff like that. Does anybody have any suggestions as to what scripts it's useful to run to help keep things running smoothly?
    We're using 9.0.1
    Cheers
    RT

    We've got a development database on which we're working every day. We intend to set up a cron job to run about once a week to help in the maintainance & performance of the database.... analyzing tables, stuff like that. Does anybody have any suggestions as to what scripts it's useful to run to help keep things running smoothly?
    We're using 9.0.1
    Cheers
    RT i'd suggest you try out oracle enterprise manager and look at the list of events you can test for. You can use this list to implement in cron or let OEM do it for you. You'll find test like, is the listener up, is the db up, is the server up, what tablespaces will not be able to extend, if a disk is getting fulletc and stuff like that . Those items should help you frame your scripts for cron if you like.

  • Manually running a cron job in SunOS 5.8

    I was looking in the Solaris documentation and UNIX Man pages, however how do I manually run a cron job that is already set-up? I am troubleshooting an issue and the cron job runs just fine during the night, I would like to execute it manually for testing purposes. Thank you in advance.

    Run this command :
    crontab -l
    And, look for the command you want to run and then just execute it on command line. The first five columns (separated by spaces) are date/time/day (skip those), after that you will see full path of the script/program. Just copy and paste that full path on command line.

  • Run a cron job every minute

    Hi,
    I would like to run a cron job every minute.
    I can find cron.hourly, cron.daily, cron.weekly, cron.monthly in my /etc, but no cron.minutly.
    Can I get it? What should I do?
    Thanks!
    Nathan

    run
    crontab -e
    . this opens an editor. therein you type :
    #min hour day month weekday command
    */1 * * * * <your command>
    dw was faster
    Last edited by DonVla (2008-11-17 16:56:42)

  • Difference of output from cron job & shell prompt

    We have a script in production like:
    sqlplus -s <username>/<password><<EOF
    set head off
    set feedback off
    set numwidth 4
    set serveroutput off
    spool /tmp/test1.txt
    prompt column1 , column2
    select column1||' , '|| column2 from <table> where <condition>;
    spool off;
    EOF
    echo "Best Regards," >> /tmp/test1.txt
    echo "IT Team" >> /tmp/test1.txt
    When run one time from the shell prompt, it gives the correct value like-
    column1, column2
    <column-1>, <column-2>
    Best Regards
    IT Team
    But when I run it from a cron job twice the output is like-
    column1, column2
    <column-1>, <column-2>
    Best Regards
    IT Team
    Best Regards
    IT Team
    The problem in the above output is that the bottom 2 statements,
    Best Regards
    IT Team
    keep getting repeated the number of times when the cron job is run. If the cron job is run 3 times the set of 2 statements get repeated thrice.
    I hope, I have been able to explain the problem.
    Requesting a reply to my query.
    Regards

    Locking this duplicate post - Difference of output from cron job & shell prompt

  • CRON job on mac

    Hello,
    Not quite the right category for this but don't think the answer would be found in the non server forum.
    I would like to schedule a CRON job on 10.5 (not server), done it in older version, either I can't remember or it's changed... doesn OSX have crontab?
    Every 1 minute I want to call a php function on a webserver (which doesn't allow CRON)....
    m

    Hi
    On OSX Client its in /usr/lib. You should see an alias for cron and within that should be what you want. However you might be able to achieve what you want with launchd and its utility launchctl? Consult the manual pages for usage.
    There is a specific Terminal and Command Line Forum over on the 10.4 Server Forum:
    http://discussions.apple.com/forum.jspa?forumID=701
    You could check this forum out as it does focus on the command line and applescript amongst other things:
    http://discussions.apple.com/category.jspa?categoryID=162
    Tony

Maybe you are looking for

  • Persisting serialized bean in EJB 3.0

    Hello, I'm seeing some surprising results in EJB 3.0 when executing an update to some bean that is unmarshalled from a remote client. Perhaps I'm misunderstanding the API, but I reached the conclusion, from documentation and various online discussion

  • What is the meaning of "i" in apple products?

    what is the meaning of "i" in apple products? i means "my" or any other answers? iOS means iphone Operating System so , iphone means my phone , internet phone or any other meanings? Can any one please clear my doubt? Thank you.

  • I cannot find my original disks for Adobe Web Premium CS4.  How do I move the software from my old laptop to a new one?

    I purchased a new laptop and am in the process of installing all my software.  Due to a recent move, I cannot find my installation disks for Web Premium CS4.  Is there a way to move the software from the old laptop to the new one?  I am a casual user

  • How do i get my apps back on phone after a software upgrade

    I did a software update on my Sony Experia ION LT28at yesterday and I lost all my apps. I know how and did go to the play store and download the same apps except one and I know its in my google acct because I saw it yesterday but I don't know where I

  • BPM scenario: error in SMQ1

    Hi friends, i have created a basic and simple scenario  using BPM. i'm sending a xml file and receiving the same file without any transformation. but  i'm getting SYS FAIL error in SMQ1. error is "password logon no longer possible. too many failed at