Sponsored Content
Full Discussion: crontab format
Top Forums UNIX for Dummies Questions & Answers crontab format Post 302398002 by d3158 on Tuesday 23rd of February 2010 02:41:47 PM
Old 02-23-2010
crontab format

I need to write a php reminder program. I can execute the file in "putty" and then right away it displays time in seconds and I get my reminder message in the email. The problem is I need to set a time for when I should get a email precisely.

Here is the outline:
1) This php program will not display a web page and will be run using cron.
2) The program will open a text file containing a series of lines. Each line contains: hour, minute, day, month, year, email, reminder message.
3) When the program runs, it will open the file. Parse through the file looking for lines that are this time. If one is found it will craft an email to the given email address and send the reminder.

The program is named: lab6part1.php
Here is my code:

Code:
#!/usr/bin/php

<?php
$to= "blah@hotmail.com";
$subject = "Reminder";
$message = "This is a reminder";
mail($to,$subject ,$message);

$time = time();
echo $time. "\n";
$returnValue = mktime(4, 28, 24, 2, 23, 2010);
?>

Another program is named: lab6part1.txt
Code:
3;15;21;2;2010;blah@hotmail.com;Hello

Another program is name: crontab
Code:
*/6 * * * * /home/student/2009/aaa*****/lab6part1.php >> /dev/null 2>&1

At this point I am completely lost in the maze. I need some serious advice, guidance. Your contribution(s) is highly appreciated.

Thanks

Last edited by Scott; 02-23-2010 at 03:51 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

convert mmddyy date format to ccyyddd format??

hi, for reading a cobol indexed file i need to convert "mmddyy" date format to "ccyyddd" format. i checked the datecalc and other scripts but couldnt modify them to cater to my need:(... The datecalc gives an output which i believe is the total days till that date, but i want to convert it... (2 Replies)
Discussion started by: Bhups
2 Replies

2. UNIX for Advanced & Expert Users

Convert UTF8 Format file to ANSI format

:) Hi i am trying to convert a file which is in UTF8 format to ANSI format i tried to use the function ICONV but it is throwing error Function i used it as $ iconv -f UTF8 -t ANSI filename Error iam getting is NOT Supported UTF8 to ANSI please some help me out on this.........Let me... (1 Reply)
Discussion started by: rajreddy
1 Replies

3. UNIX for Dummies Questions & Answers

Convert UTF8 Format file to ANSI format

:confused: Hi i am trying to convert a file which is in UTF8 format to ANSI format i tried to use the function ICONV but it is throwing error Function i used it as $ iconv -f UTF8 -t ANSI filename Error iam getting is NOT Supported UTF8 to ANSI please some help me out on... (9 Replies)
Discussion started by: rajreddy
9 Replies

4. UNIX for Dummies Questions & Answers

To convert multi format file to a readable ascii format

Hi I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like öƒ.ƒ.„İİ¡Š·œƒ.„İİ¡Š· ) in it. I want to standardize the file into ASCII format & later use that as source . Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies

5. UNIX for Advanced & Expert Users

why the date format dont work in crontab

Hi I tried to put a cron job which pipes the logfile appended to date +%d but it didnt work . anyone know how to make this happen thanks in advance -prasad (7 Replies)
Discussion started by: p4cldba
7 Replies

6. Shell Programming and Scripting

need a clarification on crontab time format

hi, what exaclt means the below in crontab 30 8-20/2 * * 1-5 /home/devtest/run.sh (1 Reply)
Discussion started by: mail2sant
1 Replies

7. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

8. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

9. Shell Programming and Scripting

perl module to convert xlsx format to xls format

Hi Folks, I have written a perl script that reads data from excel sheet(.xls) using Spreadsheet::ParseExcel module. But the problem is this module doesn't work for excel sheets with extension .xlsx. I have gone through Spreadsheet::XLSX module with which we can read from .xlsx file directly.... (1 Reply)
Discussion started by: giridhar276
1 Replies

10. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies
RCLOCK(1)							       2003								 RCLOCK(1)

NAME
rclock - clock and appointment reminder for X11 SYNOPSIS
rclock [options] DESCRIPTION
rclock -- version 2.7.10 -- is an analog clock for X intended as an xclock(1) replacement that conserves memory and has extra features: rclock enters reverse video if there is mail waiting; an appointment reminder is also builtin. OPTIONS
The options supported by rclock: -display displayname Attempt to open a window on the named X display. In the absence of this option, the display specified by the DISPLAY environment variable is used. -geometry geom Create the window with the specified X window geometry [default 80x80]. -bg color Window background color [default white]. -fg color Window foreground color [default black]. -fn fontname Select font used for reminders [default 7x14]. -nodate Do not display today's date on the face of the clock. -iconic Start iconified, if supported by the window manager. -adjust ddhhmm Adjust the clock by +/- ddhhmm (dd = days, hh = hours, mm = minutes) to fix an incorrect clock without being root or for working in another time-zone. -update n Update clock face every n seconds [default 30]. If n=1, a seconds hand is displayed. -mail n Check for new mail every n seconds [default 60]. The actual interval is a multiple of the clock update interval. -mailfile mailfile Override environmental variable MAIL with mailfile as location for mail. -mailspawn cmd Execute cmd when the face of the clock is clicked by the mouse button. #geom Specify the preferred icon window size [default 65x65]. Some of these options may not be available based on how rclock was compiled. Run rclock -help to determine which features are available. X RESOURCES
No X resources are used -- only command-line options. TITLES AND ICONS
The window and icon titles are set to the day of the week and the date. The date is also displayed on the lower half of the clock unless the -nodate option is specified. The icon window is "active" and will show the time, if supported by the window manager. REMINDERS
The ~/.rclock file lists the messages to display and/or the programs to run at specified times and dates. At the specified time, rclock will pop-up a window in the center of the screen to display the message or will simply run the scheduled program. rclock will reads the ~/.rclock file at startup, and every 10 minutes (to look for changes) and after a message window has been dismissed (to find the next appointment). An entry in ~/.rclock may be one of two formats (blank and comment lines will be ignored): hh:mm [dd] MM/DD/YY message[; program] or [hh:mm [dd] MM/DD/YY [message]]; program hh - hour (0-23; * = current) mm - minute (0-59; * = 0) dd - days-of-week (some/all/none of umtwrfs; * = all) MM - month (1-12; * = current) DD - day of month (1-31; * = current) YY - year (0-99 or 1900-????; * = current) message - message to display program - program to execute The days-of-the-week use the following abbreviations: u=Sunday, m=Monday, t=Tuesday, w=Wednesday, r=Thursday, f=Friday, s=Saturday, *=all. If message is empty and program has been specified, it is executed without a dialog box. If time/date are also not specified, program is executed on start-up. Note message may contain escape values ( : newline, ;: semicolon). Here's a silly example file that shows some of the permissible constructs: # ~/.rclock - My appointment file # startup functions ; xsetroot -solid Black & # cron functions 10:00; xsetroot -solid Grey25 & 14:00; xsetroot -solid Grey75 & # daily/weekly reminders 08:15 mtwrf * Good Morning! Read News?; rxvt -e News 12:00 mtwrf * Lunch Time! 17:00 mtwrf * Go Home 23:00 mtwrf * Still Here? Go to bed 08:10 twrf * Did you do your time card yesterday? 15:00 f * Friday, do your time card early! 16:00 mtwr * Do your time card 16:30 mtwrf * Did you do your time card? *:00 us * It's the weekend, why are you here? 8:15 f */13/* Friday the 13th! Careful! 8:15 * 4/1/* fkrkrmfismsmkd...dkdfk 8:16 * 4/1/* April Fools! # birthdays/anniversaries 16:00 05/21/* Pam's Birthday (next week) 16:00 05/24/* Pam's Birthday (in a few days) # once-of appointments 08:30 03/15/94 Dentist appointment 08:30 03/15/1999 Dentist appointment 08:30 03/15/2004 Dentist appointment ENVIRONMENT
rclock uses the environment variable MAIL to determine the location of the user's mail spool file unless the -mailfile option is specified. BUGS
rclock is not very smart about dealing with errors encountered while reading the ~/.rclock file. Each reminder must be a single line not exceeding 255 characters. Reminder windows are sometimes not redrawn (left blank) when raised or uncovered. AUTHOR
Rob Nation <nation@rocket.sanders.lockheed.com> Modifications by mj olesen <olesen@me.QueensU.CA> CURRENT MAINTAINER
Same as the current rxvt maintainer. 3rd Berkeley Distribution 26 RCLOCK(1)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy