Re: [BackupPC-users] ArchivePostUserCmd and substituted variables

2010-09-22 Thread Craig Barratt
Vincent,

> $Conf{ArchivePostUserCmd} = '/path_to_my_script/backup-offsite $HostList 
> $BackupList';
> 
> The problem is that I don't know how many hosts (and how many backup) there 
> are in the list.
> So if I get arguments with $1, $2 (my script is bash), I got 'first host' and 
> 'second host' in the list instead of 'host list' and 'backup list'.

Your best option is to add an additional argument between the
variable substitutions, eg:

$Conf{ArchivePostUserCmd} = '/path_to_my_script/backup-offsite 
$HostList -l $BackupList';

You can use shift in your bash script to read off each parameter
and use "-l" to distinguish the backup list.

Craig

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/


[BackupPC-users] ArchivePostUserCmd and substituted variables

2010-09-22 Thread Vincent Maquelle
Hello,

I'm trying to implement an 'ArchivePostUserCmd' script to copy all archives
to another site.

In this script I need to get values of $HostList and $BackupList.
For this, I defined the following command :
$Conf{ArchivePostUserCmd} = '/path_to_my_script/backup-offsite $HostList
$BackupList';

The problem is that I don't know how many hosts (and how many backup) there
are in the list.
So if I get arguments with $1, $2 (my script is bash), I got 'first host'
and 'second host' in the list instead of 'host list' and 'backup list'.

I tried quoting the arguments like this :
$Conf{ArchivePostUserCmd} = '/path_to_my_script/backup-offsite "$HostList"
"$BackupList"';
or
$Conf{ArchivePostUserCmd} = '/path_to_my_script/backup-offsite \'$HostList\'
\'$BackupList\'';

but the result is still the same.

Can anybody give me an example of how to get those values in my script.

Thanks
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/