[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Cron Help



Hello,

This is one possible method.

First, create a bash file (vi /whereever/tarMySites.sh) that looks like
this:

#!/bin/bash

cd /home/sites
tar -cf allsites.tar *
cp allsites.tar /home/sites/www.somedomain.com/backup/allsites.tar
cd /home2/sites
tar -cf allsites2.tar *
cp allsites2.tar /home/sites/www.somedomain.com/backup/allsites2.tar

Change its mode to 775: chmod 775 tarMySites.sh

Log as the user that will run the commands and edit its crontab using this:

    crontab -e

add this line:

    0 4,16 * * * /whereever/tarMySites.sh > /dev/null 2>&1

and save it (usually :wq)

I hope that it helps you on this!

Regards,
Tomás

> I need somebody to help me create a cron that will run twice a day.
> 
> The 1st is at 4am and the second at 4pm.
> 
> here is what I want the cronjob to do at those times.
> 
> 
> cd /home/sites
> tar -cf allsites.tar *
> cp allsites.tar /home/sites/www.somedomain.com/backup/allsites.tar
> cd /home2/sites
> tar -cf allsites2.tar *
> cp allsites2.tar /home/sites/www.somedomain.com/backup/allsites2.tar
> 
> Can somebody show me how to accomplish this?
> 
> Thanks,
> 
> Jim

+--                                         --+
       Tomás García Ferrari
       Bigital
       http://bigital.com/
+--                                         --+