LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 08-07-2008, 06:29 AM   #1
caksin
Member
 
Registered: Jul 2008
Location: Ankara, Türkiye
Distribution: Ubuntu, Pardus
Posts: 47

Rep: Reputation: 16
Can't make cronjobs work


in this directory,/var/spool/cron/crontabs, there are 2 files; 1 is named as the username (penguen1) and the other is "root". i have tried it on both, what is wrong with what i am trying?

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXcRiecM installed on Wed Aug 6 16:05:06 2008)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)

21 13 * * * root cd /home/penguen1/Desktop/oto tar -cvf f.tar /home/penguen1/yedekleme/rdiff

must i use any punctiations like ";" between different commands? i tried ":" after oto (the directory to backup using tar), it didn't work as well
please help

trying to do it everday some time.

Last edited by caksin; 08-07-2008 at 06:30 AM.
 
Old 08-07-2008, 07:38 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
You should not edit the crontabs files in the /var area. These are auto-generated, and will probably get over-written.

If you want to edit the crontab for any user, log in as that user (or su to it), and then use the command:
Code:
crontab -e
You can set the EDITOR environment variable if you want to use an alternative editor, for example:
Code:
EDITOR=/usr/bin/kwrite crontab -e
These user crontabs do not have the user name in them. The format would look something like this (example to execute at mid-day):
Code:
0 12 * * * command arg arg ...
To change the working directory before executing a command, do it like this:
Code:
10 12 * * * cd /new/working/directory ; command arg arg ...
The ability to use multiple commands like this may not work in some older, more conservative implementations of cron. I can confirm that it does work with anacron, YMMV with other cron implementations.

If you want to use the system crontab's (as opposed to the user cron tabs), you can add a script to /etc/cron.daily/

You need no crontab like entry at all - all scripts in /etc/cron.daily are executed once a day.
 
Old 08-07-2008, 09:49 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closing the original because the dupe
http://www.linuxquestions.org/questi...s-work-661118/
has more responses.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
some cronjobs don't work xpucto Linux - Newbie 5 05-05-2008 07:25 AM
1st time installing redhat - Make and Make Install does not work runlikeanantelope Linux - Newbie 4 02-19-2007 04:58 PM
Trying to make mod_ssl work - virtualhosts make trouble Belize Linux - Software 0 02-26-2005 09:30 PM
How do I make a change to a current kernel? Would 'make oldconfig' work... jtp51 Slackware 11 11-02-2004 12:02 AM
'make' and 'make install' commands dont work on my system? ginda Linux - Newbie 9 04-18-2004 12:17 PM


All times are GMT -5. The time now is 11:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration