Oracle date problem

Results 1 to 2 of 2

Thread: Oracle date problem

  1. #1
    Join Date
    Dec 1969

    Default Oracle date problem

    I am doing an ASP project, and I need set a cron job in Unix to send automatic email alert while the job is not finished after 5 workdays. How to find a day is workday or weekend and how to calculate time? Does anyone know the anwser?<BR><BR>Thanks!<BR>

  2. #2
    Join Date
    Dec 1969

    Default First you have one job that can run

    for 5 workdays?! I might have misunderstood there ; )<BR><BR>Anyways I&#039;m not sure exactly what you are asking here. Are you scheduling your cron job to run periodically which then executes say a shell script to determine if other running "job" is longer than 5 days? Or are you simply trying to schedule your cron to run during weekdays and/or a specific time?<BR><BR>If you are trying to schedule your cron to run during specific days/times then use a crontab (as opposed to just cron) file and do the following from a command line:<BR><BR>to edit your crontab file:<BR> crontab -e<BR><BR>here are some examples of entries:<BR>15 6 * * 1-5 /myroot/myscript.job<BR><BR>This literally reads execute the myscript.job every weekday at 6:15 am.<BR><BR>There are six fields in each crontab line with the first five being your date and time fields (minute, hour, day of month, month of year, and day of week) and the last field is a string which you would like to be executed.<BR><BR>You can also have multiple lines in your crontab.<BR><BR>For example:<BR><BR>15 6 * * 1-5 /myroot/myscript.job<BR>00 8 * * 1-5 /myroot/rm *.tmp<BR><BR>This says run my job at 6:15 am every weekday then delete all the .tmp files at 8:00 am every morning.<BR><BR>I hope that helps and I would suggest that you go with a simple solution like maybe checking the difference between log file date/times from your long running job and/or checking for the existence of a log file produced at end of job.<BR><BR>You get the idea.<BR><BR>Good luck<BR>Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts