Schedule a cronjob start everyday automatically

-5

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.

Anonymous Anurag

Posted 2013-01-24T20:08:01.783

Reputation: 1

Question was closed 2013-01-24T20:23:15.857

1You 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 – 2013-01-24T20:13:27.467

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 – 2013-01-24T20:20:38.770

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 [ask] for more info. Have you thoroughly searched for an answer before posting? – slhck – 2013-01-24T20:22:26.030

Well, I had written up a really nice answer with steps and all. But then it got closed. me.likeSuperUser--; – James T Snell – 2013-01-24T20:42:45.887

Answers

0

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

0 10 * * * /path/to/script

Nate

Posted 2013-01-24T20:08:01.783

Reputation: 151

thanks. actually i am not much familiar with linux. can you explain how to write a bash script. – Anonymous Anurag – 2013-01-24T20:18:01.667

1You 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 – 2013-01-24T20:21:55.140

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 – 2013-01-24T20:23:16.580