Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What will be the right cronjob command to move files from x folder to y folder based on a file name keywords? i'm using Debian 6.0 squeeze, and kinda new to cronjobs.

share|improve this question

closed as too localized by EEAA, Michael Hampton, John Gardeniers, voretaq7 Nov 11 '12 at 0:55

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Cron jobs are no different than standard shell scripts for the most part. Write a shell script to do what you want and then run it as a corn job. – EEAA Aug 18 '12 at 22:14
ok..i can do that, only i don't know the correct command for keywords...i need the script to move files that have the word "example" in them (just as an example :) – Guy1984 Aug 18 '12 at 22:18
We're not here to do your work for you. I'd suggest that you go out and do some of your own research on she'll scripting. When you have done that, come back to us with specific questions you have on the process. – EEAA Aug 18 '12 at 22:24
I didn't ask for you to do the work for me..i just didn't knew how to call a keyword in a command. – Guy1984 Aug 18 '12 at 22:28
up vote 0 down vote accepted

You can add into crontab something like:

0 1 * * *   mv  /x/*example*  /y

That pattern is a shell pattern to find more details about this run man bash and search for "Pattern Matching" in the "Pathname Expansion" section.

share|improve this answer
Thank you Mircea. thats what i needed to know to go forward, i just didn't knew how to call a keyword. – Guy1984 Aug 18 '12 at 22:27

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