Can a .sh script stored in c:\scripts\ (Windows part of filesystem) be run from crontab?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can a .sh script stored in c:\scripts\ (Windows part of filesystem) be run from crontab?

Peder Sverdrup
Hi,
I have my own backupscript, lets call it "bup.sh". It is stored on the c-drive, in the directory c:\scripts\.
When I open the cygwin terminal I can run the script manually. But if I include it in my crontab, it does not run.
If I copy the script to /home/myuser/myscripts/ I can run it from the cygwin terminal, and it also runs from crontab.

Is it not possible to run scripts stored on "the Windows part of the filetree" from crontab?
The crontab entries are:
10  14  *  *  *  /cygdrive/c/scripts/bup.sh
20 14  *  *  *  /home/myuser/myscripts/bup.sh

When I run the script manually, I navigate to the folder where it is stored and do
./bup.sh &

Kind regards, Peder

--
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

Reply | Threaded
Open this post in threaded view
|

Re: Can a .sh script stored in c:\scripts\ (Windows part of filesystem) be run from crontab?

Andrey Repin
Greetings, Peder Sverdrup!

> I have my own backupscript, lets call it "bup.sh". It is stored on the
> c-drive, in the directory c:\scripts\.
> When I open the cygwin terminal I can run the script manually. But if I
> include it in my crontab, it does not run.
> If I copy the script to /home/myuser/myscripts/ I can run it from the
> cygwin terminal, and it also runs from crontab.

> Is it not possible to run scripts stored on "the Windows part of the filetree" from crontab?
> The crontab entries are:
> 10  14  *  *  *  /cygdrive/c/scripts/bup.sh
> 20 14  *  *  *  /home/myuser/myscripts/bup.sh

> When I run the script manually, I navigate to the folder where it is stored and do
> ./bup.sh &

Run it as sh -x .../script and see what it does in each case.
Most likely you are missing something simple.


--
With best regards,
Andrey Repin
Thursday, July 28, 2016 13:25:20

Sorry for my terrible english...


--
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

Reply | Threaded
Open this post in threaded view
|

Re: Can a .sh script stored in c:\scripts\ (Windows part of filesystem) be run from crontab?

Warren Young-2
In reply to this post by Peder Sverdrup
On Jul 27, 2016, at 9:31 AM, Peder Sverdrup <[hidden email]> wrote:
>
> When I open the cygwin terminal I can run the script manually. But if I include it in my crontab, it does not run.

Append something like “ > /bup.log 2>&1 “ to the end of your crontab lines and examine the output.  That will probably clue you into the problem; if not, post the output here.


--
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