-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' [email protected]:/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.

4
  • 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
    Commented Jan 24, 2013 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. Commented Jan 24, 2013 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
    Commented Jan 24, 2013 at 20:22
  • Well, I had written up a really nice answer with steps and all. But then it got closed. me.likeSuperUser--; Commented Jan 24, 2013 at 20:42

1 Answer 1

0

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

0 10 * * * /path/to/script
3
  • thanks. actually i am not much familiar with linux. can you explain how to write a bash script. Commented Jan 24, 2013 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
    Commented Jan 24, 2013 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
    Commented Jan 24, 2013 at 20:23

Not the answer you're looking for? Browse other questions tagged .