Try running the script as a non-SU user: you'll probably find
it'll fail. If it does, use something like 'god' to give the
crontab suitable permissions OR (and probably more sensibly)
change the file permissions on the .htpasswd files so the
cron daemon can write to it.

Richy.
[speaking personally]
--
Richard Chiswell, Systems Developer.
Cradley Print Group.
All opinions and comments expressed are NOT necessarily those of the Cradley
Print.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Gia
> Mccue
> Sent: Wednesday, October 10, 2001 1:01 AM
> To: [EMAIL PROTECTED]
> Subject: [Perl-unix-users] running htpasswd from a script executed by a
> cron job
>
>
> I set up a cron job to execute a program that rewrites
> a .htpasswd file.  The program reads another file to
> find out which logins are valid by date.  Then writes
> a new .htpasswd file.  The program works fine when
> executed manually, but when it runs on schedule from
> the crontab it executes every line of the program
> except the ones that create the new passwords.
>
> These two lines do not execute when run from crontab,
> but do execute when run mannually:
>
> `htpasswd -cb $htpwd testlogin testpw`;
>
> and
>
> `htpasswd -b $htpwd $this_login $this_pw`;
>
> where:
> $htpwd =
> "/virtual/harmo7/public_html/hc/buy/download/.htpasswd";
>
>
> crontab:33 * * * * /usr/local/bin/perl
> /virtual/harmo7/public_html/cgi-bin/buy/old_pw.pl
>
> This also works:
> 33 * * * *
> /virtual/harmo7/public_html/cgi-bin/buy/old_pw.pl
>
> I ran another test program to try to excecute command
> line commands, like copying a file and they run fine
> from crontab.
>
>
> Any suggestions??
>
> Gia McCue
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> _______________________________________________
> Perl-Unix-Users mailing list. To unsubscribe go to
> http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users
>


-- 
The information contained within this e-mail sent by Cradley Print Ltd. is
confidential and is intended for the named recipient only. If you are not
the intended recipient please notify us by telephone immediately on 01384
414100 (UK)or +(44)1384 414100 (International) or return it to us by e-mail
quoting the name of the sender and the addressee. Please then delete it from
your system.

Encryption and Viruses
==================
Please note that this e-mail and any attachments have not been encrypted.
They may therefore be liable to be compromised. Please also note that it is
your responsibility to scan this e-mail and any attachments for viruses.
Viruses and compromises of security are inherent risks in relation to
e-mail.

We do not, to the extent permitted by law, accept any liability (whether in
contract, negligence or otherwise) for any virus infection and/or external
compromise of security and/or confidentiality in relation to transmissions
sent by e-mail.

Contracts
========
Please note, that contracts may NOT be concluded on behalf of Cradley Print 
Ltd by e-mail, but contracts on behalf of our clients may be concluded by 
e-mail.
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to