LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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


Reply
  Search this Thread
Old 01-31-2013, 08:15 PM   #1
Electromancer
LQ Newbie
 
Registered: Jan 2013
Posts: 12

Rep: Reputation: Disabled
Help with command


Where is the users crontab located?
 
Old 01-31-2013, 08:17 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,569

Rep: Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499
A test file with entries should be in /var/spool/cron by user name.
 
1 members found this post helpful.
Old 01-31-2013, 08:28 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,382
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
If you want to create or edit a cron job as user, in a terminal as user issue the command

Code:
crontab -e
It will open the file for editing. Here's a good description of the process.

Where the crontab files are stored can vary with the distribution, but it's normally somewhere in /etc. You can use the locate command to find the files on your distro. Taking a look at man crontab and man cron can also help for your distro.

Edit: Thanks, yancek!

Last edited by frankbell; 01-31-2013 at 08:29 PM.
 
1 members found this post helpful.
Old 01-31-2013, 08:34 PM   #4
Electromancer
LQ Newbie
 
Registered: Jan 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Hey thanks so much guys! I appreciate it.
 
Old 01-31-2013, 09:13 PM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Two more things:

crontab -e fires up your favorite editor. By default that is vi/vim. If that happens not to be your favorite editor: you quit that with ESC-:q!. People have been resetting their computer because they could not think of something that obvious.

If you want a different editor, like nano, issue this command:
Code:
export VISUAL=nano
export EDITOR=nano
Or you can edit that in your ~/.bashrc.

Second, the 'e' happens to be next to the 'r' on your keyboard. When you accidently hit crontab -r instead of crontab -e your crontab is wiped out. Very convenient.

And no, I don't make backups of my clients, only servers.

jlinkels

Last edited by jlinkels; 02-01-2013 at 10:29 AM.
 
Old 02-01-2013, 12:52 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
To get out of vi/vim, use ' Esc :q! '
Using the 'w' will write whatever cr*p you managed to type first into the crontab; not what you want.
 
Old 02-01-2013, 10:29 AM   #7
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Yes, you're right! Stupid mistake!

jlinkels
 
  


Reply



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
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 01:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 03:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM
how to copy drive using dd and tee command parallely? source code of dd command mdfakkeer Linux - Software 1 02-10-2010 01:31 PM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 06:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 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
Open Source Consulting | Domain Registration