X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.5 required=5.0 tests=BAYES_40,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Sun, 9 Aug 2009 02:59:15 +1000 Message-ID: <12e24baa0908080959u7bd1125cm63d36d3c61d85214@mail.gmail.com> Subject: problems with cron & permissions From: michael trott To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com hi all, sure uve heard it all before. trying to get cron to backup my system to a samba share thats mounted to a local drive. i can run the script and back up fine. This is my crontab: Michael AT home-pc ~ $ crontab -l # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.7ktN9TGaeS installed on Sun Aug 9 02:49:06 2009) # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $) * * * * * /home/Michael/scrpits/backup.sh _____________________________________________________ I've confirmed that if i put a basic echo date > to_file.txt in crontab works fine. This is the error i'm recevieing in cron.log: $ cat cron.log This file was written by the /usr/bin/cronlog script on 20090809_022001 From: root (Cron Daemon) To: Michael Subject: Cron /home/Michael/scrpits/backup.sh X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: ls: cannot access /cygdrive/z/backups/Family/: No such file or directory ls: cannot access /cygdrive/z/backups/Michael/: No such file or directory tar: Removing leading `/' from member namestar (child): /cygdrive/z/backups/Michael/Michael_09-08-09.tar.bz : Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now /home/Michael/scrpits/backup.sh: line 16: []: command not found tar (child): tar: Removing leading `/' from member names /cygdrive/z/backups/Family/Family_09-08-09.tar.bz: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now /home/Michael/scrpits/backup.sh: line 22: []: command not found _____________________________________________________ Location of the scripts: Michael AT home-pc ~/scrpits $ l total 5.0K -rwxr-xr-x 1 Michael None 835 Aug 9 01:32 backup.sh -rw-r--r-- 1 Michael None 49 Aug 9 02:18 temp.sh Michael AT home-pc ~/scrpits $ pwd /home/Michael/scrpits _____________________________________________________ This is the location of the share: Michael AT home-pc /cygdrive/z/backups/Family $ l total 4.0M -rw-r--r-- 1 Michael None 10 Aug 9 01:49 test Michael AT home-pc /cygdrive/z/backups/Family $ l ./../ total 0 drwxr-xr-x 1 Michael None 0 Aug 9 01:49 Family drwxr-xr-x 1 Michael None 0 Aug 9 01:37 Michael _____________________________________________________ I originally had cron running as system, thought it may be to do with permissions, so now running cron as my user, still same problem. I can't chmod or chown the dir's above. Anyone have any ideas or suggestions? Just to reiterate works perfectly when i initiate the script myself. thanks alot Michael -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple