UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 20th, 2004, 08:43 AM
Infinite Loop Infinite Loop is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 34 Infinite Loop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 35 sec
Reputation Power: 5
I need help with crontab!!!!!

okay, i want to write a script to back up a data file i created

this is what i have so far


#!/bin/bash


45 10 * * * * /user/bin/backup file.data

(i call this file backupfile)

and thats it for the script....


then i got to the command line and type "crontab backup"

when its time for the cron to execute, i get a email error stating

your cron job


produced the following output:

sh: core: execute permission denied


i do not understand what is going on...can someone please help!

Reply With Quote
  #2  
Old October 21st, 2004, 08:32 AM
Donboy's Avatar
Donboy Donboy is offline
The Evil Monkey
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 220 Donboy User rank is Private First Class (20 - 50 Reputation Level)Donboy User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 38 m 10 sec
Reputation Power: 6
I think you misunderstand how crontab works. You need to edit /etc/crontab and add this line...


45 10 * * * /user/bin/backup

This will run the command /usr/bin/backup at 10:45 each day.

You should google search for crontab and it should answer most of your questions. Crontab is a very well-documented feature.

Reply With Quote
  #3  
Old October 22nd, 2004, 01:48 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,089 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 3 h 45 m 21 sec
Reputation Power: 9
donboy
>>>>>You need to edit /etc/crontab and<<<<<
new feature ???
i use 'crontab -e' and the files are in
/var/spool/cron/crontabs/<username>
my (old) solaris 5.9 says: don't edit this files by hand, but
use the crontab cmd

infinite:
#!/bin/bash
45 10 * * * * /user/bin/backup file.data

that's definitely wrong
a) remove the bash line
b) remove ONE star (read man pages)
c) check permissions of exec filename
d) try to be compatible, bash is not

i suppose the core is due to the superfluos '*'

Last edited by guggach : October 22nd, 2004 at 01:57 AM. Reason: typo

Reply With Quote
  #4  
Old October 22nd, 2004, 06:52 AM
Donboy's Avatar
Donboy Donboy is offline
The Evil Monkey
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 220 Donboy User rank is Private First Class (20 - 50 Reputation Level)Donboy User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 38 m 10 sec
Reputation Power: 6
>> i use 'crontab -e'

Yeah, that works too. I'm on RH/Fedora and there is an /etc/crontab where you can add them too.

Reply With Quote
  #5  
Old October 22nd, 2004, 07:11 AM
guggach guggach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Middle Europa
Posts: 1,089 guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level)guggach User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 3 h 45 m 21 sec
Reputation Power: 9
donboy
/etc/crontab is not unix, that's all.

Reply With Quote
  #6  
Old October 25th, 2004, 01:38 AM
gurdeepdua gurdeepdua is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 gurdeepdua User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,
Don't use "bash" in crontab entry. You can use bash in your backup script file. Also use "crontab -e" to edit ur crontab entry as suggected ib above threads.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > I need help with crontab!!!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway