Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Is there a way to have Linux run a command every X minutes?

I want to run a command which will be synchronize my remote folder data to my local computer. command is sync -ave 'ssh -p 22' root@prime-focos.com:/home/home/home/Prime_Office/Medienarchiv/EPaper/India_avg_sync /home/home/Test_anuragvijaya

this is the command which I want to run everyday on a particular time. is it possible that I will schedule this command. so it will automatically run on a particular time. like i want to run this command daily at 10 am morning.

please suggest me how to write the program for this job.

share|improve this question

marked as duplicate by slhck Jan 24 '13 at 20:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
You make it a cronjob, as you said in your title (and the tags). I'm missing the question here. Did you experience any problems while setting up your cronjob? –  slhck Jan 24 '13 at 20:13
    
I know it can be possible with cronjob but i am not familiar with linux. so if you write how to do it. it is easy for me to compete. –  Anonymous Anurag Jan 24 '13 at 20:20
    
Sorry, but there are so many resources out there on how to create cronjobs… We do require questions to show some effort into solving a problem yourself. Please read How to Ask for more info. Have you thoroughly searched for an answer before posting? –  slhck Jan 24 '13 at 20:22
    
thanks. I will search for it. –  Anonymous Anurag Jan 24 '13 at 20:32
    
Well, I had written up a really nice answer with steps and all. But then it got closed. me.likeSuperUser--; –  Doc Jan 24 '13 at 20:42
add comment

1 Answer 1

I recommend first putting that command into a bash script. Then, add this to your crontab:

0 10 * * * /path/to/script
share|improve this answer
    
thanks. actually i am not much familiar with linux. can you explain how to write a bash script. –  Anonymous Anurag Jan 24 '13 at 20:18
1  
You don't need to put the command in a script—you can run it straight from the crontab. @AnonymousAnurag, this is something you might want to look up in a tutorial or two. This is a very basic thing you should be able to find out quite easily when you search online. –  slhck Jan 24 '13 at 20:21
    
The easiest way would be to just put your command in a file and save it somewhere. Then you could just put that whole line as something like: 0 10 * * * /usr/bin/bash /path/to/your/script @slhck: I generally like them in scripts to help keep my crontab cleaner, but it's up to him. –  Nate Jan 24 '13 at 20:23
    
thank you so much. –  Anonymous Anurag Jan 24 '13 at 20:32
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.