Craig Barratt wrote:
> Les writes:
>
>
>> I have a machine thats been running backuppc for ages (still on 2.1.2).
>> All data is in /home/BackupPC, a 200gb drive sitting on Fedora core 3.
>> BackupPC runs as apache. /usr/local/BackupPC is the program directory.
>>
>> I want to install a second instance of backuppc directly onto a maxtor
>> usb drive for external backup. Note that i will be backing up the
>> localhost, not the first backuppc instance.
>>
>> I always install via source tarball.
>>
>> i have tried the following:
>>
>> 1. setup a new "backuppc" user.
>> 2. install BackupPC-3.0.0 to /usr/local/BackupPC-usb
>> 3. i left the location of the css and icons the same.
>>
>
> There are some differences between 2.x and 3.x in these
> files, but it shouldn't cause the problem you have.
>
>
>> 4. split the cgi scripts for each into different directories.
>> 5. copied and modified the init.d script to use BackupPC-usb where
>> appropriate (PID's etc)
>> 6. I also modified BackupPC.pid in /usr/local/BackupPC-usb/bin/BackupPC
>> to be BackupPC-usb.pid
>>
>
> The installations should be independent and co-exist.
>
>
>> Now...i can initially start both fine. But if i shut one down, the both
>> die. Also after a while the cgi falls over, i suspect its getting mixed up.
>>
>> Since i have mucked around and its late, so a fresh start in the morning
>> from scratch is in order ;)
>>
>> Has anyone done this successfully? I saw an old archive post related to
>> a debian way of doing it, but that hasn't helped me out.
>>
>
> It sounds like you followed the right steps. Your 2.x installation
> should keep everything in four places:
>
> - /usr/local/BackupPC
>
> - TOPDIR
>
> - CGI, css, icons
>
> - /etc/init.d/backuppc
>
> Your 3.x installation, by default, will use FHS and puts things in
> these places:
>
> - /usr/local/BackupPC-usb
>
> - TOPDIR-usb
>
> - CGI, css, icons
>
> - /var/log/BackupPC
>
> - /etc/BackupPC
>
> - /etc/init.d/backuppc-usb
>
>
>> Am i missing something?
>>
>
> I can't see the part that's wrong.
>
> There is one other place there can be a collision: $Conf{ServerPort}
> is normally set to -1 (ok), but if you use that feature you have
> to choose different TCP ports for each configuration.
>
> Provided all these locations are non-overlapping then they should
> co-exist correctly.
>
> Craig
>
Hey Craig,
thanks for the input. i did get it working after another fresh attempt
at it, i found some issues, here's how it all ended up.....
1. upgraded existing 2.1.2 to 3.0.0 - no problem (everything stayed in
/usr/local/BackupPC)
2. install 3.0.0 to /usr/local/Backup-usb
3. modify a new init.d script backuppc-usb to suit the second install.
At this point i could start both without problem. Both were set to run
as apache. cgi scripts were in different locations. I did not use tcp
ports.
Then i encountered problems, and its got more to do with the redhat
init.d script which makes use of standard redhat functions.
Basically when you did a service backuppc status or service backuppc-usb
status they would return the same pid number.
I got around this by modifying BackupPC.pid in
/usr/local/BackupPC-usb/bin/BackupPC to be BackupPC-usb.pid
Then when i would do the status command i would get 2 different pids in
both instances. But it still wasn't right.
If i did service backuppc stop it would kill both pids and bring down
the second instance.
I found the problem to be that the standard "service backuppc stop" uses
an inbuilt function (/etc/init.d/functions) "killproc" like so
killproc /usr/local/BackupPC-usb/bin/BackupPC
the killproc function in turn determines the pid using a basename, see
the excerpt below...
# Save basename.
base=${1##*/}
# Find pid.
pid=
if [ -f /var/run/${base}.pid ]; then
Thus killproc will always kill BackupPC.pid, which it ultimately divines
from the startup item
daemon --user apache /usr/local/BackupPC-usb/bin/BackupPC -d
So i renamed /usr/local/BackupPC-usb/bin/BackupPC to
/usr/local/BackupPC-usb/bin/BackupPC-usb and modified the init script
accordingly.
daemon --user apache /usr/local/BackupPC-usb/bin/BackupPC-usb -d
Problems solved...or so i thought!!!!
True though i was able to independently startup and shutdown each
instance without interfering with the other one.
I went about configuring the second instance via the cgi and all was
going well until about the 5th time i hit save then all my settings got
set to "0" or "undef" in /etc/BackupPC/config.pl, even things like the
Lang became unset which caused the cgi to not work at all.
I couldn't get around that so i decided to manually edit via good old
"vi". The second instance was a one host config only and was to backup
to a usb drive so it did not need to be changed later. I also decided to
make /etc/BackupPC/config.pl read only with 555.
Only one other minor problem.....i cannot select the host on the second
instance via the drop-down box. I need to go to host summary and get to
it that way.
Conclusion:
it works, but some issues with the cgi interaction. Maybe it was because
i had both cgi script up in firefox at the same time and i was getting
some session issues from the browser.
one other thing......
if i already had 3.0.0 installed fresh, and wanted to install a new
version 3.0.0 to a separate location the installer initially assumes it
is always an upgrade because it finds an /etc/BackupPC existing. Thus
there seems no way to do a second instance short of moving the current
fresh 3.0.0 install config dir to another location. I guess log dirs
would also have to move. Is that possible by just editing
/etc/BackupPC/config.pl? or is more required? I suspect make that the
BackupPC bin script would need to be editted?
I'd like to see the installer give you a prompt to choose a different
location for config files, log files etc incase you are installing
multiple instances.
TIA
Regards,
Les
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/