Re: Help : can not get cron work
Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 19:14:42 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 14:23:06 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: Subject: Re: Help : can not get cron work Date: Wed, 04 Jan 2006 18:00:46 -0800 lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Yep, I missed that... Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. OK, I re-installed cron using /usr/bin/cron-config and I corrected crontab by removing that linq. It still does not work. I tried a Hello Wold test with the following crontab line, * * * * * /bin/date /tmp/date.out 21 It works fine. Good. Now I come to suspect something of Cygwin setup. But I can not see anything wrong in log file of cygcheck. I attach the file. One thing to note, when I run cygcheck, it exits with an error, cygcheck -svr /tmp/cygcheck.log cygcheck: dump_sysinfo: GetVolumeInformation() failed: 1231 Is this a problem? Nope. Error 1231 means The network location cannot be reached.. Must be a network drive. Another thing, I checked the Windows event loger and I see some Information on crontab, here is the dump out: The description for Event ID ( 0 ) in Source ( /usr/sbin/cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: This is just junk that the Event Viewer adds when it doesn't know how to parse the event data. You can safely ignore it. /usr/sbin/cron : PID 6064 : (linq) CMD (rsync -azv emperor:/dev/swtools/* /cygdrive/c/bin/swtools). And this is just cron informing you exactly which job it was trying to run. Do you understand what it is about? Looking at the cron job, there could be a few possibilities for failure: cron doesn't find rsync; the wildcard gets expanded too early; rsync has output that cron doesn't know where to send because you don't have an smtp daemon running... At least your mounts look ok. Try eliminating the possibilities above by fixing your cron job... Thanks. I did some correction, now here is my crontab: crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.4232 installed on Thu Jan 5 15:02:10 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) * * * * * /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools Again I tested that the command, /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools works fine if I type it on shell. Does it work from a SYSTEM-owned shell (search the archives for sysbash)? I still can not make it work. The last suggestion you give is about smtp daemon, I do not quite understand. Could you elabrate on that? Whenever a cron job writes anything to stdout/stderr, cron tries to email the output to the user whose crontab it's running. If you don't have an smtp daemon running, the cron job will fail (IIRC). Try redirecting the output to a file in a known location. You can also try starting an smtp daemon (there are a couple in Cygwin, AFAIR), but redirection is so much easier. Thanks, I tried that and this time I know what is going wrong. The problem is rsync. Here is the logging of the error, Could not create directory '/cygdrive/h/.ssh'. Host key verification failed. rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/tmp/rsync-2.6.6/io.c(584) This is really confusing. I can run the command manually, no problem. But in cron it does not work. From its error message, I see 2 problem
Re: Help : can not get cron work
On Tue, 10 Jan 2006, lin q wrote: Isn't 'H' a network drive? That is probably your problem -- read http://cygwin.com/faq/faq.using.html#faq.using.shares. Thanks, I think you are right, after check out this page, I think it is the problem. But I wonder how we can do it. Well, for one thing, the only reason you need H: is because your home directory is on it. You can have a home directory on a local drive instead, so that it's accessibe to services (you can then create a symbolic link from your home directory to the network drive). There are 3 suggestions over there, 1) using public network share that does not require authentication (for non-critical files) 2) providing your password to a net use command 3) running the service as your own user with cygrunsrv -u But 1) does not apply here in my environemnt. Ok. 2), I do not quite understand it. And I think I can not use it either. I tried net use H: * trying to set up the password, but it errors out on syntax. That's because net use expects the full path to the share as part of the command (if you want to attach to it). So, just figure out what share H: is referring to (say, \\server\SHARE), and then issue the following command: net use H: '\\server\SHARE' '*' (the quoting is for bash -- I think you can omit it at the DOS prompt). 3), In the very beginning I used cygrunsrv command to start cron, but there is some problem. And earlier in this thread I was suggested to use cron-config. Actually below are the screenshot of my running cron-config, you can see that it specifically asked me whether to setup the service as my own, $ /usr/bin/cron-config Cron is already installed as a service under account XLNX\jibinh. Do you want to remove or reinstall it? (yes/no) yes OK. The cron service was removed. Do you want to install the cron daemon as a service? (yes/no) yes The service can run either as yourself or under a privileged account. Running as yourself allows better access to network drives, but does not allow to run the crontab of other users. Do you want to the cron daemon to run as yourself? (yes/no) yes Do you want the daemon to run with ntsec? (yes/no) yes Please enter the password for user 'linq': ** Reenter: ** WARNING: /usr/sbin/sendmail should point to an executable mailer such as ssmtp or exim. Do you want to start the cron daemon as a service now? (yes/no) yes OK. The cron daemon is now running. In case of problem, examine the log file for cron, /var/log/cron.log, and the Windows event log for information about the problem cron is having. If you cannot fix the problem, then report it to [EMAIL PROTECTED] Please include a copy of your crontab, ('crontab -l') and the output of 'cygcheck -srv cygcheck.txt'. Please include the generated file 'cygcheck.txt' *as an attachment*, and NOT in the body of the mail message. Umm, okay, this seems to have completed successfully. Is cron now running? Does the simple hello world example work? What error does your original rsync command give in this case? Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte. But no -- you are no fool; you call yourself a fool, there's proof enough in that! -- Rostand, Cyrano de Bergerac -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Help : can not get cron work
Subject: Re: Help : can not get cron work Date: Tue, 10 Jan 2006 18:52:11 -0500 (EST) On Tue, 10 Jan 2006, lin q wrote: Isn't 'H' a network drive? That is probably your problem -- read http://cygwin.com/faq/faq.using.html#faq.using.shares. Thanks, I think you are right, after check out this page, I think it is the problem. But I wonder how we can do it. Well, for one thing, the only reason you need H: is because your home directory is on it. You can have a home directory on a local drive instead, so that it's accessibe to services (you can then create a symbolic link from your home directory to the network drive). This is something I am confused. Here is my crontab, $ crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.5456 installed on Tue Jan 10 18:22:18 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) USER=linq USERNAME=linq HOME=/cygdrive/c/home/linq HOMEDRIVE=C: * * * * * echo $LOGNAME /tmp/logname 21 * * * * * echo home=$HOME user=$USER username=$USERNAME hostname=$HOSTNAME homedrive=$HOMEDRIVE /tmp/ulog 21 * * * * * ssh -vv hican /tmp/ssh_log 21 And here is the contents of /tmp/ulog and /tmp/logname which log environment variables, $ cat /tmp/ulog home=/cygdrive/c/home/linq user=linq username=linq hostname=linq2 homedrive=C: $ cat /tmp/logname linq You can see that the home is on C drive which is my local drive. But here is /tmp/ssh_log which logs the exact ssh errors, and you can see that it goes to access H drive. OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005 Pseudo-terminal will not be allocated because stdin is not a terminal. debug1: Reading configuration data /etc/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to hican [149.199.109.155] port 22. debug1: Connection established. Could not create directory '/cygdrive/h/.ssh'. debug1: identity file /cygdrive/h/.ssh/identity type -1 debug1: identity file /cygdrive/h/.ssh/id_rsa type -1 debug1: identity file /cygdrive/h/.ssh/id_dsa type -1 debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p2 debug1: match: OpenSSH_3.6.1p2 pat OpenSSH_3.* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.2 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[EMAIL PROTECTED],zlib debug2: kex_parse_kexinit: none,[EMAIL PROTECTED],zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED] debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED] debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_init: found hmac-md5 debug1: kex: server-client aes128-cbc hmac-md5 none debug2: mac_init: found hmac-md5 debug1: kex: client-server aes128-cbc hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(102410248192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug2: dh_gen_key: priv key bits set: 133/256 debug2: bits set: 511/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug2: no key of type 0 for host hican debug2: no key of type 2 for host hican debug1: read_passphrase: can't open /dev/tty: No such device or address Host key verification failed. Here is /etc/ssh_config, # $OpenBSD: ssh_config,v 1.20 2005/01/28 09:45:53 dtucker Exp $ # This is the ssh client system-wide configuration file. See # ssh_config(5) for more information. This file provides defaults for # users
Re: Help : can not get cron work
OK, now I figure out what is the problem. /etc/passwd file is not correct, after I fix it, rsync in cron works great. Thanks so much for your every help! From: lin q [EMAIL PROTECTED] To: cygwin@cygwin.com Subject: Re: Help : can not get cron work Date: Tue, 10 Jan 2006 18:47:06 -0700 Subject: Re: Help : can not get cron work Date: Tue, 10 Jan 2006 18:52:11 -0500 (EST) On Tue, 10 Jan 2006, lin q wrote: Isn't 'H' a network drive? That is probably your problem -- read http://cygwin.com/faq/faq.using.html#faq.using.shares. Thanks, I think you are right, after check out this page, I think it is the problem. But I wonder how we can do it. Well, for one thing, the only reason you need H: is because your home directory is on it. You can have a home directory on a local drive instead, so that it's accessibe to services (you can then create a symbolic link from your home directory to the network drive). This is something I am confused. Here is my crontab, $ crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.5456 installed on Tue Jan 10 18:22:18 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) USER=linq USERNAME=linq HOME=/cygdrive/c/home/linq HOMEDRIVE=C: * * * * * echo $LOGNAME /tmp/logname 21 * * * * * echo home=$HOME user=$USER username=$USERNAME hostname=$HOSTNAME homedrive=$HOMEDRIVE /tmp/ulog 21 * * * * * ssh -vv hican /tmp/ssh_log 21 And here is the contents of /tmp/ulog and /tmp/logname which log environment variables, $ cat /tmp/ulog home=/cygdrive/c/home/linq user=linq username=linq hostname=linq2 homedrive=C: $ cat /tmp/logname linq You can see that the home is on C drive which is my local drive. But here is /tmp/ssh_log which logs the exact ssh errors, and you can see that it goes to access H drive. OpenSSH_4.2p1, OpenSSL 0.9.8a 11 Oct 2005 Pseudo-terminal will not be allocated because stdin is not a terminal. debug1: Reading configuration data /etc/ssh_config debug2: ssh_connect: needpriv 0 debug1: Connecting to hican [149.199.109.155] port 22. debug1: Connection established. Could not create directory '/cygdrive/h/.ssh'. debug1: identity file /cygdrive/h/.ssh/identity type -1 debug1: identity file /cygdrive/h/.ssh/id_rsa type -1 debug1: identity file /cygdrive/h/.ssh/id_dsa type -1 debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p2 debug1: match: OpenSSH_3.6.1p2 pat OpenSSH_3.* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.2 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED],aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,[EMAIL PROTECTED],zlib debug2: kex_parse_kexinit: none,[EMAIL PROTECTED],zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED] debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,[EMAIL PROTECTED] debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[EMAIL PROTECTED],hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_init: found hmac-md5 debug1: kex: server-client aes128-cbc hmac-md5 none debug2: mac_init: found hmac-md5 debug1: kex: client-server aes128-cbc hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(102410248192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug2: dh_gen_key: priv key bits set: 133/256 debug2: bits set: 511/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug2: no key of type 0 for host hican debug2: no key of type 2 for host hican debug1: read_passphrase: can't open /dev/tty: No such device
Re: Help : can not get cron work
From: Brian Dessent [EMAIL PROTECTED] Reply-To: cygwin@cygwin.com To: cygwin@cygwin.com Subject: Re: Help : can not get cron work Date: Wed, 04 Jan 2006 18:00:46 -0800 lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. Brian -- OK, I re-installed cron using /usr/bin/cron-config and I corrected crontab by removing that linq. It still does not work. I tried a Hello Wold test with the following crontab line, * * * * * /bin/date /tmp/date.out 21 It works fine. Now I come to suspect something of Cygwin setup. But I can not see anything wrong in log file of cygcheck. I attach the file. One thing to note, when I run cygcheck, it exits with an error, cygcheck -svr /tmp/cygcheck.log cygcheck: dump_sysinfo: GetVolumeInformation() failed: 1231 Is this a problem? Another thing, I checked the Windows event loger and I see some Information on crontab, here is the dump out: The description for Event ID ( 0 ) in Source ( /usr/sbin/cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: /usr/sbin/cron : PID 6064 : (linq) CMD (rsync -azv emperor:/dev/swtools/* /cygdrive/c/bin/swtools). Do you understand what it is about? _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ cygcheck.log Description: Binary data -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Help : can not get cron work
On Thu, 5 Jan 2006, lin q wrote: From: Brian Dessent [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. Subject: Re: Help : can not get cron work Date: Wed, 04 Jan 2006 18:00:46 -0800 lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Yep, I missed that... Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. OK, I re-installed cron using /usr/bin/cron-config and I corrected crontab by removing that linq. It still does not work. I tried a Hello Wold test with the following crontab line, * * * * * /bin/date /tmp/date.out 21 It works fine. Good. Now I come to suspect something of Cygwin setup. But I can not see anything wrong in log file of cygcheck. I attach the file. One thing to note, when I run cygcheck, it exits with an error, cygcheck -svr /tmp/cygcheck.log cygcheck: dump_sysinfo: GetVolumeInformation() failed: 1231 Is this a problem? Nope. Error 1231 means The network location cannot be reached.. Must be a network drive. Another thing, I checked the Windows event loger and I see some Information on crontab, here is the dump out: The description for Event ID ( 0 ) in Source ( /usr/sbin/cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: This is just junk that the Event Viewer adds when it doesn't know how to parse the event data. You can safely ignore it. /usr/sbin/cron : PID 6064 : (linq) CMD (rsync -azv emperor:/dev/swtools/* /cygdrive/c/bin/swtools). And this is just cron informing you exactly which job it was trying to run. Do you understand what it is about? Looking at the cron job, there could be a few possibilities for failure: cron doesn't find rsync; the wildcard gets expanded too early; rsync has output that cron doesn't know where to send because you don't have an smtp daemon running... At least your mounts look ok. Try eliminating the possibilities above by fixing your cron job... HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ [EMAIL PROTECTED] | [EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-'old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte. But no -- you are no fool; you call yourself a fool, there's proof enough in that! -- Rostand, Cyrano de Bergerac -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Help : can not get cron work
From: Igor Peshansky [EMAIL PROTECTED] Reply-To: cygwin@cygwin.com To: lin q [EMAIL PROTECTED] CC: cygwin@cygwin.com Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 14:23:06 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: From: Brian Dessent [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. Subject: Re: Help : can not get cron work Date: Wed, 04 Jan 2006 18:00:46 -0800 lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Yep, I missed that... Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. OK, I re-installed cron using /usr/bin/cron-config and I corrected crontab by removing that linq. It still does not work. I tried a Hello Wold test with the following crontab line, * * * * * /bin/date /tmp/date.out 21 It works fine. Good. Now I come to suspect something of Cygwin setup. But I can not see anything wrong in log file of cygcheck. I attach the file. One thing to note, when I run cygcheck, it exits with an error, cygcheck -svr /tmp/cygcheck.log cygcheck: dump_sysinfo: GetVolumeInformation() failed: 1231 Is this a problem? Nope. Error 1231 means The network location cannot be reached.. Must be a network drive. Another thing, I checked the Windows event loger and I see some Information on crontab, here is the dump out: The description for Event ID ( 0 ) in Source ( /usr/sbin/cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: This is just junk that the Event Viewer adds when it doesn't know how to parse the event data. You can safely ignore it. /usr/sbin/cron : PID 6064 : (linq) CMD (rsync -azv emperor:/dev/swtools/* /cygdrive/c/bin/swtools). And this is just cron informing you exactly which job it was trying to run. Do you understand what it is about? Looking at the cron job, there could be a few possibilities for failure: cron doesn't find rsync; the wildcard gets expanded too early; rsync has output that cron doesn't know where to send because you don't have an smtp daemon running... At least your mounts look ok. Try eliminating the possibilities above by fixing your cron job... HTH, Igor -- Thanks. I did some correction, now here is my crontab: crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.4232 installed on Thu Jan 5 15:02:10 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) * * * * * /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools Again I tested that the command, /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools works fine if I type it on shell. I still can not make it work. The last suggestion you give is about smtp daemon, I do not quite understand. Could you elabrate on that? One last thing, /var/log/cron.log only says [628] cron started. I wonder where I can get more data on how on the earch the command is run. Any idea? _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Help : can not get cron work
On Thu, 5 Jan 2006, lin q wrote: From: Igor Peshansky [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: lin q [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Again, http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 14:23:06 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: From: Brian Dessent [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. Subject: Re: Help : can not get cron work Date: Wed, 04 Jan 2006 18:00:46 -0800 lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Yep, I missed that... Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. OK, I re-installed cron using /usr/bin/cron-config and I corrected crontab by removing that linq. It still does not work. I tried a Hello Wold test with the following crontab line, * * * * * /bin/date /tmp/date.out 21 It works fine. Good. Now I come to suspect something of Cygwin setup. But I can not see anything wrong in log file of cygcheck. I attach the file. One thing to note, when I run cygcheck, it exits with an error, cygcheck -svr /tmp/cygcheck.log cygcheck: dump_sysinfo: GetVolumeInformation() failed: 1231 Is this a problem? Nope. Error 1231 means The network location cannot be reached.. Must be a network drive. Another thing, I checked the Windows event loger and I see some Information on crontab, here is the dump out: The description for Event ID ( 0 ) in Source ( /usr/sbin/cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: This is just junk that the Event Viewer adds when it doesn't know how to parse the event data. You can safely ignore it. /usr/sbin/cron : PID 6064 : (linq) CMD (rsync -azv emperor:/dev/swtools/* /cygdrive/c/bin/swtools). And this is just cron informing you exactly which job it was trying to run. Do you understand what it is about? Looking at the cron job, there could be a few possibilities for failure: cron doesn't find rsync; the wildcard gets expanded too early; rsync has output that cron doesn't know where to send because you don't have an smtp daemon running... At least your mounts look ok. Try eliminating the possibilities above by fixing your cron job... Thanks. I did some correction, now here is my crontab: crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.4232 installed on Thu Jan 5 15:02:10 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) * * * * * /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools Again I tested that the command, /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools works fine if I type it on shell. Does it work from a SYSTEM-owned shell (search the archives for sysbash)? I still can not make it work. The last suggestion you give is about smtp daemon, I do not quite understand. Could you elabrate on that? Whenever a cron job writes anything to stdout/stderr, cron tries to email the output to the user whose crontab it's running. If you don't have an smtp daemon running, the cron job will fail (IIRC). Try redirecting the output to a file in a known location. You can also try starting an smtp daemon (there are a couple in Cygwin, AFAIR), but redirection is so much easier. One last thing, /var/log/cron.log only says [628] cron started. I wonder where I can get more data on how on the earch the command is run. You can run syslogd, IIRC, to get the syslog events written to a file instead of the Windows Event Log. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_Igor Peshansky, Ph.D. (name changed!) |,4
Re: Help : can not get cron work
From: Igor Peshansky [EMAIL PROTECTED] Reply-To: cygwin@cygwin.com To: lin q [EMAIL PROTECTED] CC: cygwin@cygwin.com Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 17:32:17 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 14:23:06 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: From: Brian Dessent [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. Subject: Re: Help : can not get cron work Date: Wed, 04 Jan 2006 18:00:46 -0800 lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Yep, I missed that... Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. OK, I re-installed cron using /usr/bin/cron-config and I corrected crontab by removing that linq. It still does not work. I tried a Hello Wold test with the following crontab line, * * * * * /bin/date /tmp/date.out 21 It works fine. Good. Now I come to suspect something of Cygwin setup. But I can not see anything wrong in log file of cygcheck. I attach the file. One thing to note, when I run cygcheck, it exits with an error, cygcheck -svr /tmp/cygcheck.log cygcheck: dump_sysinfo: GetVolumeInformation() failed: 1231 Is this a problem? Nope. Error 1231 means The network location cannot be reached.. Must be a network drive. Another thing, I checked the Windows event loger and I see some Information on crontab, here is the dump out: The description for Event ID ( 0 ) in Source ( /usr/sbin/cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: This is just junk that the Event Viewer adds when it doesn't know how to parse the event data. You can safely ignore it. /usr/sbin/cron : PID 6064 : (linq) CMD (rsync -azv emperor:/dev/swtools/* /cygdrive/c/bin/swtools). And this is just cron informing you exactly which job it was trying to run. Do you understand what it is about? Looking at the cron job, there could be a few possibilities for failure: cron doesn't find rsync; the wildcard gets expanded too early; rsync has output that cron doesn't know where to send because you don't have an smtp daemon running... At least your mounts look ok. Try eliminating the possibilities above by fixing your cron job... Thanks. I did some correction, now here is my crontab: crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.4232 installed on Thu Jan 5 15:02:10 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) * * * * * /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools Again I tested that the command, /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools works fine if I type it on shell. Does it work from a SYSTEM-owned shell (search the archives for sysbash)? I still can not make it work. The last suggestion you give is about smtp daemon, I do not quite understand. Could you elabrate on that? Whenever a cron job writes anything to stdout/stderr, cron tries to email the output to the user whose crontab it's running. If you don't have an smtp daemon running, the cron job will fail (IIRC). Try redirecting the output to a file in a known location. You can also try starting an smtp daemon (there are a couple in Cygwin, AFAIR), but redirection is so much easier. Thanks, I tried that and this time I know what is going wrong. The problem is rsync. Here is the logging of the error, Could not create directory '/cygdrive/h/.ssh'. Host key verification failed. rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/tmp/rsync-2.6.6/io.c(584) This is really confusing. I can run the command manually, no problem. But in cron it does
Re: Help : can not get cron work
I guess including this in the body wasn't prominent enough... AGAIN: http://cygwin.com/acronyms/#PCYMTNQREAIYR. Please read the meaning of this acronym before continuing this thread. Thanks. On Thu, 5 Jan 2006, lin q wrote: From: Igor Peshansky [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: lin q [EMAIL PROTECTED] CC: [EMAIL PROTECTED] The above is what http://cygwin.com/acronyms/#PCYMTNQREAIYR refers to. Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 17:32:17 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: Subject: Re: Help : can not get cron work Date: Thu, 5 Jan 2006 14:23:06 -0500 (EST) On Thu, 5 Jan 2006, lin q wrote: From: Brian Dessent [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] http://cygwin.com/acronyms/#PCYMTNQREAIYR. Thanks. Subject: Re: Help : can not get cron work Date: Wed, 04 Jan 2006 18:00:46 -0800 lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Yep, I missed that... Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. OK, I re-installed cron using /usr/bin/cron-config and I corrected crontab by removing that linq. It still does not work. I tried a Hello Wold test with the following crontab line, * * * * * /bin/date /tmp/date.out 21 It works fine. Good. Now I come to suspect something of Cygwin setup. But I can not see anything wrong in log file of cygcheck. I attach the file. One thing to note, when I run cygcheck, it exits with an error, cygcheck -svr /tmp/cygcheck.log cygcheck: dump_sysinfo: GetVolumeInformation() failed: 1231 Is this a problem? Nope. Error 1231 means The network location cannot be reached.. Must be a network drive. Another thing, I checked the Windows event loger and I see some Information on crontab, here is the dump out: The description for Event ID ( 0 ) in Source ( /usr/sbin/cron ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: This is just junk that the Event Viewer adds when it doesn't know how to parse the event data. You can safely ignore it. /usr/sbin/cron : PID 6064 : (linq) CMD (rsync -azv emperor:/dev/swtools/* /cygdrive/c/bin/swtools). And this is just cron informing you exactly which job it was trying to run. Do you understand what it is about? Looking at the cron job, there could be a few possibilities for failure: cron doesn't find rsync; the wildcard gets expanded too early; rsync has output that cron doesn't know where to send because you don't have an smtp daemon running... At least your mounts look ok. Try eliminating the possibilities above by fixing your cron job... Thanks. I did some correction, now here is my crontab: crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.4232 installed on Thu Jan 5 15:02:10 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) * * * * * /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools Again I tested that the command, /usr/bin/rsync -azv emperor:/devl/swtools c:/bin/swtools works fine if I type it on shell. Does it work from a SYSTEM-owned shell (search the archives for sysbash)? I still can not make it work. The last suggestion you give is about smtp daemon, I do not quite understand. Could you elabrate on that? Whenever a cron job writes anything to stdout/stderr, cron tries to email the output to the user whose crontab it's running. If you don't have an smtp daemon running, the cron job will fail (IIRC). Try redirecting the output to a file in a known location. You can also try starting an smtp
Re: Help : can not get cron work
On Wed, 4 Jan 2006, lin q wrote: Hi, I just installed a brand new cygwin on my WinXP machine, but I can not get cron work for me. Here is how I did it: 1) cygrunsrv -I cron -p /usr/sbin/cron -a -D 2) crontab -e to edit the crontab file, here is the dump out, $ crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.2836 installed on Wed Jan 4 10:14:53 2006) # (Cron version -- $Id: crontab.c,v 1.8 2004/12/21 16:14:41 corinna Exp $) 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools 3) cygrunsrv -S cron If I go to start --Administritive tools --service, I can see that cron is started. I tried that command in crontab, rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools, it works fine if i run it on shell manually. Any suggestion is highly appreciated. What makes you think cron doesn't work? Did you try adding the Hello World of crontabs, i.e., * * * * * linq /bin/date /tmp/date.out 21 ? Did it work for you? As for your current problem... Does the cron log show anything? What about the Windows Event Log? Try fully qualifying the path rsync, quoting the '*', and redirecting both stdout and stderr to some file (you may also need to redirect stdin from /dev/null). HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte. But no -- you are no fool; you call yourself a fool, there's proof enough in that! -- Rostand, Cyrano de Bergerac -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Help : can not get cron work
lin q wrote: 1) cygrunsrv -I cron -p /usr/sbin/cron -a D You should run /usr/bin/cron-config, and not try to do this by hand because there is much more to do than just installing the service. 16 10 * * * linq rsync -azv emperor:/dev/tools/* /cygdrive/c/bin/tools That is not the proper format of a user's crontab line. There is no such username field as the fifth field in a user's crontab, it should just be 16 10 * * * rsync It was trying to execute a command named linq that does not exist, and there should be errors to this effect in the Windows Event Log. See man 5 crontab. Also realize that if you do not have system-wise mounts and Cygwin in the PATH the above will not work. This would have been evident if you attached the cygcheck output as requested in http://cygwin.com/problems.html. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/