A backup script

Hello

I'm a new user of this forum. English is not my natural language so excuse me by advance if my sentences are not always really understandable :-p

Well here is my problem.

I use a panel and I need to use the backup command of this panel to backup all my customer account (created under this panel)
I may use an option like "backup --domains=all" but in this case the backup command run during more than 3 hours and use huge ressources (cpu, etc..)
So my idea is to create a shell script to backup some domains every hours. For example every domains that begin by "A
" would be backuped at 01:00AM, every "B*" at 02:00AM, etc....

I have the list of all domains listed in /etc/httpd/conf.d

My idea is to do soemthing like this

My two main problems are :
1/ I don't know how to write in SHELL command the line

2/ I don't know how to remove the .conf at the end of the $TOBACKUP (domain.com.conf)

Of course it is not a very beautifull script. It could be best to calculate the number of existing domains then divise it by 24 hours and backup the result every hours, but for me it become to strong :-p so I prefere to begin by soemthing simple

There is maybe others solutions to not backup all my customer account in one shot but few per hours or days.

I'd really apreciate your help about my 2 mains pbms and all advises/comments you may give me to realise this.

Thanks a ton

Pascal

You can use the date command to extract the current hour.

Here is a starter script for you..

#! /bin/ksh

PATH2CONF=/etc/httpd/conf.d

HOUR=$(date +%H)

case $HOUR in
00) DOM=A ;;
01) DOM=B ;;
.
.
.
23) DOM=W ;;
esac

Look at this script to see how .conf is removed.

sh-2.05b$ ls
auth_mysql.conf  python.conf        ssl.conf
auth_pgsql.conf  perl.conf  README             
authz_ldap.conf  php.conf   squirrelmail.conf  welcome.conf
sh-2.05b$ for file in *
> do 
> echo ${file%.conf}
> done
auth_mysql
auth_pgsql
authz_ldap
perl
php
python
README
squirrelmail
ssl
welcome

Vino

thanks a ton

Pascal