Create cron job without root


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Create cron job without root
# 1  
Old 10-09-2014
Create cron job without root

Hi there,

I need to create a crone job to backup certain files on my disk without root permissions.
Also if I will be able to edit cronetab then I need to know how to edit it with any editor other than vim Smilie
# 2  
Old 10-09-2014
What OS are you using?
# 3  
Old 10-09-2014
centos 5.10, 64-bit
# 4  
Old 10-09-2014
try $editor=(your choice of editor)
$export editor
then...
try crontab -e (your username)

---------- Post updated at 10:32 AM ---------- Previous update was at 10:28 AM ----------

Amend: your Editor statements might be upper case i.e.: EDITOR=(...)
# 5  
Old 10-09-2014
Most UNIX have a /var/adm/cron/ directory where you find the allow and deny files for cron and at command but in linux I suppose you find then in /etc...
Just to say that to be able to use cronfiles the user must be allowed, if you dont have a cron.allow or cron.deny file then it should be OK, if not the user must be added...
As to edit... you would have to create your crontab file first following its syntax:
Code:
#  Minute    Hour    Month_Day    Month    Weekday    Command
#  (0-59)   (0-23)   (1-31)       (1-12)   (0-6)*0=sun run-string 
#  * = in any crontab field represents all legal values.

But linux has more options to it

Lets call the file user.cronfile
Once that done you just as user execute this way:
Code:
 crontab user.cronfile

Now each time you want to modify - 2 options :
Either you edit your fuser.cronfile modify and save with the editor of your choice...
and you need to load the modified file again:
Code:
 crontab user.cronfile

OR
You use, being the user:
Code:
 crontab -e

to modify and save ( but its strangely looking like vi hehe...)
# 6  
Old 10-09-2014
vi-hater's cheat sheet for vi:
  • i: Stop beeping at me and enter writing mode you stupid program
  • esc-:-w-q-enter: Save and quit
  • esc-:-q-!-enter: Quit without saving
  • esc-d-d: Delete a line because backspace isn't good enough for you
  • esc-esc-esc: what in the world are you doing now, quit it, stop doing that

They told me I would come to love vi as I learned to use it. That of course never happened. Knowing the basics is still useful.
This User Gave Thanks to Corona688 For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

CRON JOB not running - for tape backup from root user

I am trying a cron on root user to backup to tape using TAR command here is the cron entry 11 08 * * 6 /erdhot1cron 2>&1 >> /test3/scripts/dba/erdhot1cron.log here is script inside - edhot1cron #!/bin/bash vsysdt=`date +%d%m%y` date tar -cvf /dev/st0... (4 Replies)
Discussion started by: vijaymec50
4 Replies

2. UNIX for Dummies Questions & Answers

Need help to create cron job

Dear Experts, I want to create cronjob with the following steps: 1. go to directory /home/logs/ $cd /home/logs/ 2. copy to /tmp/ the most recent file with "prefix" local_data_ and sufix ".gz" ls -ltr drwxr-xr- 4096 Nov 24 2009 bak drwxr-xr-x 24096 Aug... (6 Replies)
Discussion started by: maxsub
6 Replies

3. Shell Programming and Scripting

Cron job initiating ssh AND sudo (from user, not root)

I've been bashing my head on the desk for 2 days trying to get this to work, but I've had no luck. I'll try to be as clear as possible in my explanation without dragging out the details. I'm trying to set up a cron job for user "john" which runs a script. This script initiates an ssh connection to... (5 Replies)
Discussion started by: eh3civic
5 Replies

4. Shell Programming and Scripting

Adding a new root cron job

Hi there, I have over 2000 systems (mainly Solaris) and I want to write a script that inserts a new root cronjob on each of those servers. obviously just adding a line to /var/spool/cron/crontabs/root looks like the easiest way, but i really dont want to have to send a HUP to crond on all boxes ... (3 Replies)
Discussion started by: rethink
3 Replies

5. Shell Programming and Scripting

Im trying to create a FTP Cron Job

Hello, Im fairly new to this and am hoping for your help in moving forward. 1. I need to carry out a FTP transfer from SERVER1 to SERVER2 at 3am every morning. 2. The FTP is to work on SERVER1 3. There will be many files to transfer (96 files per day) 4. I want to delete the files... (3 Replies)
Discussion started by: nozerf
3 Replies

6. Shell Programming and Scripting

Re : How to create this cron job?

Hello All, Hope this finds you well. I am creating this shell script that will create cron jobs in crontab file. What I am provided with is the start time , intervals and # of trials. Based of Start time ( say 7:15 am ) and interval being 15 minutes, # of trial being 5 , I should create cron... (5 Replies)
Discussion started by: samshaw
5 Replies

7. Shell Programming and Scripting

create a chmod cron job help please

hi all, I'm so embarrasingly new; apologies. So here's my dilemma; files are being uploaded to the server via a php script... this is therefore assigning ownership to 'nobody' rather than the account 'user'. It's screwing with the permissions and then the owner can't ftp download images... (2 Replies)
Discussion started by: sirj
2 Replies

8. HP-UX

How to create a cron job and run in quality system

Hi Experts, I'm a SAP Basis, I have a small doubt would request you please help on this... 1. I wold like to copy files from one system to another system? as per my knowledge "we have to mount the prod filesystem on the quality box and do a copy every day thru crontab script, or do it via... (2 Replies)
Discussion started by: mahantysk
2 Replies

9. Shell Programming and Scripting

How to create cron job automatically?

How do I write a perl script to get the cron jobs? I could do a perl -e ' system "crontab -l > jobs.txt " '; Is there a better way? Then I can use perl to make changes to jobs.txt. How can I submit the changes. I suppose I could use system "crontab jobs.txt", is there a better way? ... (0 Replies)
Discussion started by: siegfried
0 Replies

10. UNIX for Dummies Questions & Answers

Cron Sends mail to root on completion of job.

All I am running a few scripts through a cron job. This is for checking some key services that are running on by box. The problem is, everytime the cron runs, it sends a mail to the root account. The root account mails need to cleared every now and then. Is there some way I can stop these... (1 Reply)
Discussion started by: skotapal
1 Replies
Login or Register to Ask a Question