[PHP] Running a script with Crontab

2001-09-30 Thread Carlos Fernando Scheidecker Antunes

Hello All,

I wrote an script to do database maintenance and I forgot how to run a script on the 
command line without opening it with a web browser. My idea is to add a crontab daily 
entry to run this script.

Can anyone enlight me on this

thank you very much,

C.F. Scheidecker Antunes.


Linux User #207984




[PHP] Running a script with Crontab

2001-09-30 Thread ani

This is what I do, maybe is gonna help you

bash file structure:

 #!/bin/bash
 ##
 ##  mysql maintenance
 ##
 /usr/bin/mysql -u username --password=yourpassword EOF
 use yourdatabase;
 YOUR SQL query HERE;
 exit
 EOF

then
 chmod +x yourbashfile

so cronjob this file with the desired frecuency



Ani Lopez
www.laMundial.net
download our free music


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Running a script with Crontab

2001-09-30 Thread Jeffrey Paul

At 01:25 PM 9/30/2001, [EMAIL PROTECTED] wrote:
This is what I do, maybe is gonna help you

bash file structure:

  #!/bin/bash
  ##
  ##  mysql maintenance
  ##
  /usr/bin/mysql -u username --password=yourpassword EOF
  use yourdatabase;
  YOUR SQL query HERE;
  exit
  EOF

then
  chmod +x yourbashfile

so cronjob this file with the desired frecuency


BAD BAD BAD idea.

if this is a public server (linux that's not running the openwall patch, 
for example) then anyone can see your password with a `ps auxwww` while 
it's running.  Scripts I run from cron are usually recalculation scripts in 
the middle of the night that take 10-15 mins to run, and as such would give 
anyone more than enough time to grab it while the script is running, not 
that it's not possible to grab it even with a shorter execution time as well.

-j



Jeffrey Paul  [EMAIL PROTECTED]  (877) 748 3467
ICQ: 14295546 AIM: kw34hd1 NXTL/DC: 130*21*16749
PGP: 0xF50BB9D7 A21AFD828C30EC77545DA0B3F501F50BB9D7


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]