Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


Closed Thread
  Search this Thread
Old 08-07-2008, 05:29 AM   #1
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 05:30 AM.
Old 08-07-2008, 06:38 AM   #2
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:
crontab -e
You can set the EDITOR environment variable if you want to use an alternative editor, for example:
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):
0 12 * * * command arg arg ...
To change the working directory before executing a command, do it like this:
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, 08:49 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
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
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 06:25 AM
1st time installing redhat - Make and Make Install does not work runlikeanantelope Linux - Newbie 4 02-19-2007 03:58 PM
Trying to make mod_ssl work - virtualhosts make trouble Belize Linux - Software 0 02-26-2005 08:30 PM
How do I make a change to a current kernel? Would 'make oldconfig' work... jtp51 Slackware 11 11-01-2004 11:02 PM
'make' and 'make install' commands dont work on my system? ginda Linux - Newbie 9 04-18-2004 11:17 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:26 PM.

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