LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-06-2005, 10:53 PM   #1
jkassemi
Member
 
Registered: May 2004
Location: Albuquerque, NM
Distribution: slackware-current, slamd64-11
Posts: 106

Rep: Reputation: 15
cron


Hey everybody, I've got a script that runs rsync to sync up files on my development computer and a backup computer I've got on the same network... It's a one-liner (I haven't really learned how to harness the power of the scripts yet ), that looks like this:

rsync -e ssh -avz /SERVER kassemi@192.168.0.2: /BACKUP

I've set up the keys so that this will run when I'm logged in on my development computer as kassemi. crond is running as a different user though, so this command doesn't work (prompt for password).. I don't want the crond user to have access to the backup machine... I was doing some reading, and I ran across this:

crontab filename -e kassemi

If I do this to the script, will I end up messing up cron access to the other scripts I have? Will it work? How can cron run the file as kassemi without prompting me for a password every time?

Thanks,

James.

Last edited by jkassemi; 04-06-2005 at 10:54 PM.
 
Old 04-06-2005, 11:04 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Here is a tutorial on setting up ssh. Basically, if you don't want to be prompted for a password , then you just press enter for the passphrase. That's not the most secure thing but works for cron jobs.

Setting up another cron job in crontab shouldn't bother existing cron jobs.
 
Old 04-06-2005, 11:17 PM   #3
jkassemi
Member
 
Registered: May 2004
Location: Albuquerque, NM
Distribution: slackware-current, slamd64-11
Posts: 106

Original Poster
Rep: Reputation: 15
Thanks homey. Actually though, I already have that part set up... But I want to be able to run a cron job as a different user... I've got the ssh automatically set up for user: kassemi, and want to run the cron job as that user... any ideas?

Thanks,
James.
 
Old 04-06-2005, 11:29 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Edit the crontab for that user, should work
 
  


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
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron.allow and cron.deny in slackware? tl64 Slackware 5 10-13-2005 09:44 PM
No More Cron Mail, Cron Error? Xhost Linux - General 3 07-26-2004 04:28 PM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:46 PM.

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