Re: Shell script wont run with cron, but it works ok in the command line.
How can I make the mv, and rm commands excecutable by system? where I can add the path to this commands for System??? This is the hint I have been looking for since Dec 07 thanks in advance! Eric. Re: Script Doesn't Work Correctly with Cron From: Igor Pechtchanski pechtcha at cs dot nyu dot edu To: Buck Turgidson jc_va at hotmail dot com Cc: cygwin at cygwin dot com Date: Thu, 12 Dec 2002 13:26:48 -0500 (EST) Subject: Re: Script Doesn't Work Correctly with Cron Reply-to: cygwin at cygwin dot com On Thu, 12 Dec 2002, Buck Turgidson wrote: I have a script that works when I run it from the command line, but when it is executed with cron, it produces a null file. I am sure that cron is executing it because it creates the file. It is just not populated. Here is the script. I want to query an Oracle database every couple of minutes, capture some data, and append it to a flat file. I want to keep 2000 lines in the flat file. Can someone spot the error? Again, it works run from the command line. #!/bin/bash sqlplus -s scott@mydb up @ss.sql | grep -v Enter password: monsql.lst tail -2000 monsql.lst montemp.lst rm -f monsql.lst mv montemp.lst monsql.lst This is probably not cron-specific, but try redirecting stderr to a file (by using 2filename) to see if the script produces any errors. Also, are all the programs you use (sqlplus, grep, tail, rm, mv) in the path for the user that cron runs as (most likely system)? Are they executable by system? __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Shell script wont run with cron, but it works ok in the command line.
Note: forwarded message attached. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ---BeginMessage--- The cron works now!, the output its ok (date.txt). but with my script the things are different, here are the files I use.. I tested the script from the command line and work flawlesly, but when i add it to my crontab it does not work has expected! the files are atached to the mail, and the output from the script being executed by the cron its there too. hope you can help me or advise me. the main file is __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com scripts.zip Description: scripts.zip outputbadandgood.zip Description: outputbadandgood.zip ---End Message--- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
cron problem in W2K Proffesional
cygncurses++6.dll v0.0 ts=2002/1/9 0:03 226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0 cygncurses5.dll v0.0 ts=2001/4/25 0:17 202k 2002/01/09 C:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0 cygncurses6.dll v0.0 ts=2002/1/9 0:03 15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0 cygpanel5.dll v0.0 ts=2001/4/25 0:27 12k 2002/01/09 C:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0 cygpanel6.dll v0.0 ts=2002/1/9 0:03 40k 2001/11/21 C:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0 cygpcre.dll v0.0 ts=2001/11/21 16:15 39k 2001/11/21 C:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0 cygpcreposix.dll v0.0 ts=2001/11/21 16:15 22k 2002/06/09 C:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0 cygpopt-0.dll v0.0 ts=2002/6/9 0:45 108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0 cygreadline4.dll v0.0 ts=2001/1/6 22:34 127k 2002/10/10 C:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0 cygreadline5.dll v0.0 ts=2002/10/10 12:28 50k 2002/03/12 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0 cygz.dll v0.0 ts=2002/3/11 22:38 906k 2002/11/07 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0 cygwin1.dll v0.0 ts=2002/11/7 12:57 Cygwin DLL version info: DLL version: 1.3.15 DLL epoch: 19 DLL bad signal mask: 19005 DLL old termios: 5 DLL malloc env: 28 API major: 0 API minor: 63 Shared data: 3 DLL identifier: cygwin1 Mount registry: 2 Cygnus registry name: Cygnus Solutions Cygwin registry name: Cygwin Program options name: Program Options Cygwin mount registry name: mounts v2 Cygdrive flags: cygdrive flags Cygdrive prefix: cygdrive prefix Cygdrive default prefix: Build date: Thu Nov 7 13:57:47 EST 2002 CVS tag: cygwin-1-3-15-1 Shared id: cygwin1S3 Cygwin Package Information Last downloaded files to: C:\temp Last downloaded files from: ftp://archive.progeny.com/cygwin Package Version _update-info-dir00087-1 ash 20020731-1 base-files 1.0-1 base-passwd 1.0-1 bash2.05b-7 cron3.0.1-7 ctags 5.2-1 cygrunsrv 0.95-1 cygutils1.1.3-1 cygwin 1.3.15-2 diff1.0-1 diffutils 2.8.1-1 ed 0.2-1 fileutils 4.1-1 findutils 4.1.7-4 gawk3.1.1-5 gdbm1.8.0-4 gettext 0.11.5-1 grep2.5-1 gzip1.3.3-4 libiconv2 1.8-2 libintl 0.10.38-3 libintl10.10.40-1 libintl20.11.5-1 libncurses5 5.2-1 libncurses6 5.2-8 libpopt01.6.4-4 libreadline44.1-2 libreadline54.3-2 login 1.6-1 mc 4.5.55-1 nano1.1.10-1 ncurses 5.2-8 pcre3.7-1 readline4.3-2 rxvt2.7.2-14 sed 4.0.1-1 sh-utils2.0-2 tar 1.13.25-1 tcsh6.11.00-4 termcap 20020930-1 terminfo5.2-3 texinfo 4.2-4 textutils 2.0.21-1 vim 6.1-2 which 1.5-1 zlib1.1.4-1 zsh 4.0.4-1 Use -h to see help about each section as in other cases, mi cron daemon is running ok, i have checked the group and passwd files, i have checked to the directories and files permissions, every thing is ok, this should work! thanks in advance for your advice and help. Eric De La Cruz Lugo Mérida, Yucatán, México. P.D. by the way sorry for my bad english! __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Fwd: cron problem in W2K Proffesional
sh-utils2.0-2 tar 1.13.25-1 tcsh6.11.00-4 termcap 20020930-1 terminfo5.2-3 texinfo 4.2-4 textutils 2.0.21-1 vim 6.1-2 which 1.5-1 zlib1.1.4-1 zsh 4.0.4-1 Use -h to see help about each section the cron daemon is up ps -e shows: PIDPPIDPGID WINPID TTY UID STIME COMMAND 608 1 608608 con 1000 12:16:43 /usr/bin/bash 1316 11316 1316? 18 12:23:45 /usr/bin/cygrunsrv 230413161316520? 18 12:23:45 /usr/sbin/cron 860 608 860600 con 1000 12:34:43 /usr/bin/ps My windows 2000 professional event viewer shows the following (sorry is in spanish): No se encuentra la descripción del Id. de suceso ( 0 ) en el origen ( /USR/SBIN/CRON ). Es posible que el equipo local no tenga la información de Registro o archivos DLL de mensajes necesarios para mostrar mensajes desde un equipo remoto. La siguiente información es par /USR/SBIN/CRON : Win32 Process Id = 0x580 : Cygwin Process Id = 0x580 : (asuncion1) CMD (/home/asuncion1/transferFiles_propuesta). transferFiles_propuesta is the shell script i want to run!, it runs fine from the command line. thanks for your help! Eric De La Cruz Lugo Merida, Yucatan, Mexico. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ---BeginMessage--- Hi!, i just installed cygwin in my PC in order to run a shell script, this script run just fine form the command line, now i need to run this script every minute (cron and crontab issue). I have read all the mail list and FAQ and README files and applied every posible hint and advise, but my script does not run from cron. here is my configuration. Cygwin Win95/NT Configuration Diagnostics Current System Time: Fri Dec 06 10:41:26 2002 Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 2 Path: C:\cygwin\usr\local\bin C:\cygwin\bin C:\cygwin\bin c:\WINNT\system32 c:\WINNT c:\WINNT\System32\Wbem c:\Archivos de programa\progress c:\Archivos de programa\progress\bin c:\temp\bin\usr\local\wbin c:\progress\wrk\appreplicacion SysDir: C:\WINNT\System32 WinDir: C:\WINNT HOME = `C:\cygwin\home\asuncion1' MAKE_MODE = `unix' PWD = `/home/asuncion1' USER = `asuncion1' ALLUSERSPROFILE = `C:\Documents and Settings\All Users' APPDATA = `C:\Documents and Settings\asuncion1\Datos de programa' COMMONPROGRAMFILES = `C:\Archivos de programa\Archivos comunes' COMPUTERNAME = `SRVCORDEMEX' COMSPEC = `C:\WINNT\system32\cmd.exe' DLC = `c:\Archivos de programa\Progress' DLCBIN = `c:\Archivos de programa\Progress\bin' HOMEDRIVE = `C:' HOMEPATH = `\' LOGONSERVER = `\\SRVCORDEMEX' MANPATH = `:/usr/ssl/man' NUMBER_OF_PROCESSORS = `1' OLDPWD = `/usr/bin' OS2LIBPATH = `C:\WINNT\system32\os2\dll;' OS = `Windows_NT' PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH' PROCESSOR_ARCHITECTURE = `x86' PROCESSOR_IDENTIFIER = `x86 Family 15 Model 0 Stepping 10, GenuineIntel' PROCESSOR_LEVEL = `15' PROCESSOR_REVISION = `000a' PROCFG = `C:\Archivos de programa\Progress\progress.cfg' PROGRAMFILES = `C:\Archivos de programa' PROMPT = `$P$G' PROMSGS = `C:\Archivos de programa\Progress\promsgs' PROOIBRK = `C:\Archivos de programa\Progress\bin\oibrkr32.exe' PROOIDRV = `C:\Archivos de programa\Progress\bin\oidrvr32.exe' PROSTARTUP = `C:\Archivos de programa\Progress\startup_oib.pf' PS1 = `\[\033]0;\w\007 \033[32m\]\u@\h \[\033[33m\w\033[0m\] $ ' SHLVL = `1' SYSTEMDRIVE = `C:' SYSTEMROOT = `C:\WINNT' TEMP = `c:\DOCUME~1\ASUNCI~1\CONFIG~1\Temp' TERM = `cygwin' TMP = `c:\DOCUME~1\ASUNCI~1\CONFIG~1\Temp' USERDOMAIN = `SRVCORDEMEX' USERNAME = `asuncion1' USERPROFILE = `C:\Documents and Settings\asuncion1' WINDIR = `C:\WINNT' _ = `/usr/bin/cygcheck' Use `-r' to scan registry a: fd N/AN/A c: hd NTFS 19085Mb 84% CP CS UN PA FC d: fd N/AN/A C:\cygwin / system binmode C:\cygwin/bin /usr/bin system binmode C:\cygwin/lib /usr/lib system binmode . /cygdrive userbinmode,cygdrive Found: C:\cygwin\bin\bash.exe Found: C:\cygwin\bin\cat.exe Found: c:\temp\bin\usr\local\wbin\cat.exe Warning: C:\cygwin\bin\cat.exe hides c:\temp\bin\usr\local\wbin\cat.exe Not Found: cpp (good!) Found: C:\cygwin\bin\find.exe Found: c:\temp\bin\usr\local\wbin\find.exe Warning: C:\cygwin\bin\find.exe hides c:\temp\bin\usr\local\wbin\find.exe Not Found: gcc Not Found: gdb Not Found: ld Found: C:\cygwin\bin\ls.exe Found: c:\temp\bin\usr\local\wbin\ls.exe Warning: C:\cygwin\bin\ls.exe hides c:\temp\bin
Fwd: cron problem in W2K Proffesional
Information about passwd and group files Just for the record (again) passwd file: SYSTEM:*:18:544:,S-1-5-18:: Administradores:*:544:544:,S-1-5-32-544:: Administrador:unused_by_nt/2000/xp:500:513:U-SRVCORDEMEX\Administrador,S-1-5-21-854245398-1202660629-1343024091-500:/home/Administrador:/bin/bash asuncion1:unused_by_nt/2000/xp:1000:513:asuncion,U-SRVCORDEMEX\asuncion1,S-1-5-21-854245398-1202660629-1343024091-1000:/home/asuncion1:/bin/bash Gustavo:unused_by_nt/2000/xp:1007:513:GUstavo Maqy Kuk,U-SRVCORDEMEX\Gustavo,S-1-5-21-854245398-1202660629-1343024091-1007:/home/Gustavo:/bin/bash Invitado:unused_by_nt/2000/xp:501:513:U-SRVCORDEMEX\Invitado,S-1-5-21-854245398-1202660629-1343024091-501:/home/Invitado:/bin/bash IUSR_ASUNCION:unused_by_nt/2000/xp:1001:513:Cuenta de invitado a Internet,U-SRVCORDEMEX\IUSR_ASUNCION,S-1-5-21-854245398-1202660629-1343024091-1001:/home/IUSR_ASUNCION:/bin/bash IUSR_SRVCORDEMEX:unused_by_nt/2000/xp:1009:513:Cuenta de invitado a Internet,U-SRVCORDEMEX\IUSR_SRVCORDEMEX,S-1-5-21-854245398-1202660629-1343024091-1009:/home/IUSR_SRVCORDEMEX:/bin/bash IWAM_ASUNCION:unused_by_nt/2000/xp:1002:513:Iniciar la cuenta de proceso IIS,U-SRVCORDEMEX\IWAM_ASUNCION,S-1-5-21-854245398-1202660629-1343024091-1002:/home/IWAM_ASUNCION:/bin/bash IWAM_SRVCORDEMEX:unused_by_nt/2000/xp:1010:513:Iniciar la cuenta de proceso IIS,U-SRVCORDEMEX\IWAM_SRVCORDEMEX,S-1-5-21-854245398-1202660629-1343024091-1010:/home/IWAM_SRVCORDEMEX:/bin/bash rvargass:unused_by_nt/2000/xp:1003:513:Roberto Vargas,U-SRVCORDEMEX\rvargass,S-1-5-21-854245398-1202660629-1343024091-1003:/home/rvargass:/bin/bash tepeyac:unused_by_nt/2000/xp:1008:513:tepeyac,U-SRVCORDEMEX\tepeyac,S-1-5-21-854245398-1202660629-1343024091-1008:/home/tepeyac:/bin/bash group file: SYSTEM:S-1-5-18:18: Everyone:S-1-1-0:0: Ninguno:S-1-5-21-854245398-1202660629-1343024091-513:513: Administradores:S-1-5-32-544:544: Duplicadores:S-1-5-32-552:552: Invitados:S-1-5-32-546:546: Operadores de copia:S-1-5-32-551:551: Usuarios:S-1-5-32-545:545: Usuarios avanzados:S-1-5-32-547:547: SRVCORDEMEX Administradores:S-1-5-21-854245398-1202660629-1343024091-1004:1004: SRVCORDEMEX Autores:S-1-5-21-854245398-1202660629-1343024091-1005:1005: SRVCORDEMEX Visitantes:S-1-5-21-854245398-1202660629-1343024091-1006:1006: Eric De La Cruz Lugo Merida, Yucatan, Mexico __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: cron problem in W2K Proffesional
1. Have you read /usr/doc/Cygwin/cron.README? Yes. 2. Have you tried using a simple crontab entry? What have you tried? yes i am using now the following example: crontab -e * * * * * /usr/bin/date /tmp/date.txt as you suggested to Buck Turgidson but there is nothing yet in /tmp/ (6 minutes waiting) yes the /tmp directory has the 777 permissions thanks for your hints! For future reference, please include your 'cygcheck.txt' file as an attachment only. Ok, I will. Eric De La Cruz Lugo Merida Yucatan Mexico. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: cron problem in W2K Proffesional
--- Harig, Mark A. [EMAIL PROTECTED] wrote: What are the ownership/permissions for '/var'? That is, ls -ld /var drwxrwxrwx 6 Administ Ninguno 0 Apr 12 2002 /var drwxrwxrwx 3 asuncion Ninguno 0 Apr 12 2002 /var/cron drwxrwxrwx 2 asuncion Ninguno 0 Dec 6 13:04 /var/cron/tabs -rw-r- 1 asuncion SYSTEM234 Dec 6 13:04 /var/cron/tabs/asuncion1 (Ninguno = None) (sorry is windows 2k in spanish.) Eric De La Cruz Lugo Merida Yucatan Mexico __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: cron problem in W2K Proffesional
Ok, I have made the changes, now the directories show: total 4 drwxrwxrwx6 Administ Ninguno 0 Apr 12 2002 . drwxrwxrwx 10 Administ Ninguno 4096 Dec 5 19:38 .. drwxrwxrwt3 asuncion Ninguno 0 Apr 12 2002 cron drwxrwxrwx2 Administ Ninguno 0 Dec 5 18:46 log drwxrwxrwx2 Administ Ninguno 0 Dec 5 18:46 run drwxrwxrwx2 Administ Ninguno 0 Apr 12 2002 tmp total 1 drwxrwxrwt3 asuncion Ninguno 0 Dec 6 15:44 . drwxrwxrwx6 Administ Ninguno 0 Apr 12 2002 .. -rw-rw-rw-1 asuncion Ninguno 0 Dec 6 15:44 lista -rw-rw-rw-1 asuncion Ninguno 318 Dec 6 15:44 listatabs.txt drwxrwxrwt2 asuncion Ninguno 0 Dec 6 15:44 tabs total 2 drwxrwxrwt2 asuncion Ninguno 0 Dec 6 15:44 . drwxrwxrwt3 asuncion Ninguno 0 Dec 6 15:44 .. -rw-r-1 asuncion SYSTEM234 Dec 6 13:04 asuncion1 -rw-rw-rw-1 asuncion Ninguno 264 Dec 6 15:44 listacrontab.txt I restarted the cron daemon, and waited for 5 minutes, nothing happens yet. Other ideas? Eric De La Cruz Lugo Merida Yucatan Mexico - Also, once you have done this, shut down your cron service and restart it. -Original Message- From: Harig, Mark A. Sent: Friday, December 06, 2002 4:20 PM To: Eric De La Cruz Lugo; [EMAIL PROTECTED] Subject: RE: cron problem in W2K Proffesional drwxrwxrwx 3 asuncion Ninguno 0 Apr 12 2002 /var/cron drwxrwxrwx 2 asuncion Ninguno 0 Dec 6 13:04 /var/cron/tabs For some reason, your 'sticky bit' settings didn't get set for /var/cron/ and /var/cron/tabs/. Instead of 'drwxrwxrwx', your permissions should be 'drwxrwxrwt'. Try: chmod 1777 /var/cron chmod 1777 /var/cron/tabs __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: cron problem in W2K Proffesional
--- Harig, Mark A. [EMAIL PROTECTED] wrote: It appears as though everything is set correctly. Try: 1. Shut down your cron service. Done. 2. Run Cygwin's setup.exe to uninstall 'cron'. Done. 3. Run setup.exe a second time to download/install a new copy of 'cron'. Done. 4. Reboot your computer. Done. 5. Check your crontab: crontab -l Done it shows: # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.1036 installed on Fri Dec 6 13:04:23 2002) # (Cron version -- $Id: crontab.c,v 1.6 2001/09/19 17:09:55 corinna Exp $) * * * * * /usr/sbin/date /tmp/date.txt 6. Install the cron service and start it. cygrunsrv -I cron -p /usr/sbin/cron -a -D -e CYGWIN=tty ntsec cygrunserv -S cron ps -e shows: PIDPPIDPGID WINPID TTY UID STIME COMMAND 1560 11560 1560 con 1000 17:35:32 /usr/bin/bash 1420 11420 1420? 18 17:36:52 /usr/bin/cygrunsrv 138414201420 1132? 18 17:36:52 /usr/sbin/cron 104015601040 1648 con 1000 17:45:21 /usr/bin/ps waited for 8 minutes and checked /tmpguess what??? NOTHING! there is no output yet :( no date.txt anything else? other aproach to this problem? Eric De La Cruz Lugo Merida Yucatan, Mexico. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: cron problem in W2K Proffesional
The cron works now!, the output its ok (date.txt). but with my script the things are different, here are the files I use.. I tested the script from the command line and work flawlesly, but when i add it to my crontab it does not work has expected! the files are atached to the mail, and the output from the script being executed by the cron its there too. hope you can help me or advise me. the main file is __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com scripts.zip Description: scripts.zip outputbadandgood.zip Description: outputbadandgood.zip -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/