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

I wrote three bash files:

  1. incremental_backup
  2. full_backup
  3. execution

Now I want another bash script do the following :

if (date is the start of month 1/-/----)
    invoke `full_back_up`
    invoke `incremental_backup`

How can I write this script?

share|improve this question
up vote 11 down vote accepted

Don't do this. Instead use two separate cron jobs to invoke your tasks.

15 5 1 * * scripts/full_back_up
15 5 2-31 * * scripts/incremental_backup
share|improve this answer


if [ `date +%d` != "01" ] 
share|improve this answer
Your answer's the same as mine, and earlier, so I deleted mine. You might want to de-capitalise the "I" in your fisrt "if", though! – MadHatter Nov 3 '10 at 10:02
You should leave your answer up. There are quite a lot of duplicate answers on the site. It all adds to the community. – Iain Nov 3 '10 at 10:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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