running scripts (manual and auto)
I usually download mail from my ISP by running the following command as user horacio: $ fetchmail -v -a -u my_id and I just created a script with that line and named it /home/horacio/getmail: - start getmail - #!/bin/sh fetchmail -v -a -u my_id - end getmail - and gave it executable permissions(0777): 1 -rwxrwxrwx 1 horacio horacio This works providing I run it like: $ ./getmail but how can I make it ran as a normal command (without ./). Also, I created another script in /etc/ppp/ip-up.d/: - start script - #/bin/sh fetchmail -f /home/horacio/.fetchmailrc -a -u a4608456 runq - end script - named it 02fetchmail, and gave it the following permissions: 1 -rwxr-xr-x 1 root root so that it fetchs mail from my ISP at connection, but this one doesn't work at all... what's wrong with it? I too have another two scripts in the same directory: - start 01sendmail - #!/bin/sh # Flush exim queue if [ -x /usr/sbin/exim ]; then /usr/sbin/exim -qf fi - end 01sendmail - (actually, this is just the default exim script renamed), and: - start 00time - #!/bin/sh /usr/sbin/rdate -s slug.ctv.es /sbin/hwclock --systohc - end 00time - I think these two work (don't really know for sure). TIA Horacio
Re: running scripts (manual and auto)
J Horacio MG wrote: I usually download mail from my ISP by running the following command as user horacio: $ fetchmail -v -a -u my_id and I just created a script with that line and named it /home/horacio/getmail: - start getmail - #!/bin/sh fetchmail -v -a -u my_id - end getmail - and gave it executable permissions(0777): 1 -rwxrwxrwx 1 horacio horacio This works providing I run it like: $ ./getmail but how can I make it ran as a normal command (without ./). I place my Perl scripts in /usr/local/bin. I would think that would work for you. I can't help you with the next one:( hth, kent Also, I created another script in /etc/ppp/ip-up.d/: - start script - #/bin/sh fetchmail -f /home/horacio/.fetchmailrc -a -u a4608456 runq - end script - named it 02fetchmail, and gave it the following permissions: 1 -rwxr-xr-x 1 root root so that it fetchs mail from my ISP at connection, but this one doesn't work at all... what's wrong with it? I too have another two scripts in the same directory: - start 01sendmail - #!/bin/sh # Flush exim queue if [ -x /usr/sbin/exim ]; then /usr/sbin/exim -qf fi - end 01sendmail - (actually, this is just the default exim script renamed), and: - start 00time - #!/bin/sh /usr/sbin/rdate -s slug.ctv.es /sbin/hwclock --systohc - end 00time - I think these two work (don't really know for sure). TIA Horacio -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null
Re: running scripts (manual and auto)
Hi, I cannot explain why your case does not work. But I think it is more convient to use the fetchmail in the following way. put a fetchmail, like your script in /etc/ppp/ip-up.d/. and then put a fetchmailrc mail in your root directory, and run fetchmail as root. In your fetchmailrc, have something like user horacio there has password is user horacio here. then root will forward all these mails to user horacio. You can then use .forward with procmail or exim to do the fitering... Hope this helps... shao. On Sun, May 16, 1999 at 02:48:42PM +0200, J Horacio MG wrote: I usually download mail from my ISP by running the following command as user horacio: $ fetchmail -v -a -u my_id and I just created a script with that line and named it /home/horacio/getmail: - start getmail - #!/bin/sh fetchmail -v -a -u my_id - end getmail - and gave it executable permissions(0777): 1 -rwxrwxrwx 1 horacio horacio This works providing I run it like: $ ./getmail but how can I make it ran as a normal command (without ./). Also, I created another script in /etc/ppp/ip-up.d/: - start script - #/bin/sh fetchmail -f /home/horacio/.fetchmailrc -a -u a4608456 runq - end script - named it 02fetchmail, and gave it the following permissions: 1 -rwxr-xr-x 1 root root so that it fetchs mail from my ISP at connection, but this one doesn't work at all... what's wrong with it? I too have another two scripts in the same directory: - start 01sendmail - #!/bin/sh # Flush exim queue if [ -x /usr/sbin/exim ]; then /usr/sbin/exim -qf fi - end 01sendmail - (actually, this is just the default exim script renamed), and: - start 00time - #!/bin/sh /usr/sbin/rdate -s slug.ctv.es /sbin/hwclock --systohc - end 00time - I think these two work (don't really know for sure). TIA Horacio -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null -- Shao Zhang - Running Debian 2.1 ___ _ _ Department of Communications/ __| |_ __ _ ___ |_ / |_ __ _ _ _ __ _ University of New South Wales \__ \ ' \/ _` / _ \ / /| ' \/ _` | ' \/ _` | Sydney, Australia |___/_||_\__,_\___/ /___|_||_\__,_|_||_\__, | Email: [EMAIL PROTECTED] |___/ _
Re: running scripts (manual and auto)
On Sun, 16 May 1999, Kent (ktb) wrote on behalf of Horacio: Horacio: but how can I make it ran as a normal command (without ./). Kent: I place my Perl scripts in /usr/local/bin. I would think that would work for you. I can't help you with the next one:( hth, kent Horacio: If you put the script in /usr/local/bin and that directory is in your path, as Kent says, you will be able to run the scripts there by typeing the command name. That directory is in my default directory, and should be in yours. If you want to run a script that resides in your home directory, you probably should just type ./script_name to run it, since there is no . (refers to current, i.e. working, directory) in the default path. This has to do with safety from executing trojan horses. If you insist on running stuff from your current directory, without the ./, then add . to your path by placing this line in your .profile, or .bash_profile export PATH=$PATH:. If you run tcsh or other shell, someone else will have to help. --David David Teague, [EMAIL PROTECTED] Debian GNU/Linux Because software support is free, timely, useful, technically accurate, and friendly. (Hope this qualifies.)
Re: running scripts (manual and auto)
J Horacio MG writes: - start script - #/bin/sh fetchmail -f /home/horacio/.fetchmailrc -a -u a4608456 runq - end script - That first line should read #!/bin/sh . -- John HaslerThis posting is in the public domain. [EMAIL PROTECTED] Do with it what you will. Dancing Horse Hill Make money from it if you can; I don't mind. Elmwood, Wisconsin Do not send email advertisements to this address.
Re: running scripts (manual and auto)
John Hasler dixit: ~ J Horacio MG writes: ~ - start script - ~ #/bin/sh ~ ~ fetchmail -f /home/horacio/.fetchmailrc -a -u a4608456 ~ ~ runq ~ - end script - ~ ~ That first line should read #!/bin/sh . Sorry for the typo... the script is correct though (but doesn't work), what may be wrong with it? -- Horacio [EMAIL PROTECTED] Valencia - ESPAÑA