Hello,
I think you should try something like
ssh -fnCNg -L 9112:localhost:9112 -R 9101:backupserver:9101 -R 9103:backupserver:9103 [EMAIL PROTECTED]
then define a storage resource in bacula-dir.conf wich adress is localhost and port 9103
in the job ressource, use this storage device and 9112 for FD port in client resource.
I use that on 4 linux behind a firewall. These are the scripts I use for runbefore and run after each job :
Best regards, Ludovic Strappazon
RunBefore :
#!/bin/bash
if test $# -lt 2 ; then echo "usage: ouvreTunnel.ssh <host> <port>" exit 1 fi
if [ -d /tmp/Tunnels/${1}/${2} ]
then
echo "Erreur : tunnel fantome $1 $2" >> /var/log/tunnels
exit 1
else
mkdir -p /tmp/Tunnels/${1}/${2}
/usr/bin/ssh -fnCNg -L 9112:localhost:9112 -R 9101:hunt.u-strasbg.fr:9101 -R 9103:hunt.u-strasbg.fr:9103 [EMAIL PROTECTED] -p $2 > /dev/null 2> /tmp/Tunnels/${1}/${2}/erreurs
Process=`ps -ef | grep "/usr/bin/ssh -fnCNg -L 9112:localhost:9112 -R 9101:hunt.u-strasbg.fr:9101 -R 9103:hunt.u-strasbg.fr:9103 [EMAIL PROTECTED] -p $2$" | awk '{print $2}'`
touch /tmp/Tunnels/${1}/${2}/${Process}
ERREURS=`cat /tmp/Tunnels/${1}/${2}/erreurs | wc -c`
if [ $ERREURS -ne 0 ]
then
kill $Process
rm -rf /tmp/Tunnels/${1}/${2}/
fi
exit $ERREURS
fi
RunAfter :
#!/bin/bash
if test $# -lt 2 ; then echo "usage: fermeTunnel.ssh <host> <port>" exit 1 fi
Process=`ls /tmp/Tunnels/${1}/${2}/ | grep -v erreurs` rm -rf /tmp/Tunnels/${1}/${2}/ kill $Process 2> /dev/null exit 0
Chris Joelly wrote:
Hello!
i try to backup a remote w2k server using the "Run Before Job" parameter to build a ssh tunnel to the bacula-fd on the remote server with the following script
backup:~# cat /etc/bacula/scripts/mk_ssh2w2k.sh #!/bin/bash
# dig a tunnel to the remote office server start-stop-daemon --start -b --exec /usr/bin/ssh -- -N -2 -o "StrictHostKeyChecking no" -i /etc/bacula/bacula-ssh-key -L 9112:192.168.100.100:9102 [EMAIL PROTECTED]
exit 0
and the following job definition:
Job { Name = "srv-remote" Type = Backup Client = srv-remote FileSet = "Full Set Windows" Schedule = "WeeklyCycle" Storage = FileStorage-srv-remote Messages = Standard Pool = Default Full Backup Pool = File-Full-Pool Incremental Backup Pool = File-Inc-Pool Differential Backup Pool = File-Diff-Pool Write Bootstrap = "/var/lib/bacula/srv-remote.bsr" Run Before Job = "/etc/bacula/scripts/mk_ssh2w2k.sh" Run After Job = "/etc/bacula/scripts/rm_ssh2w2k.sh" }
for the client:
Client {
Name = srv-remote
Address = local-backupserver
FDPort = 9112 Catalog = MyCatalog
Password = "dir-pass" File Retention = 60 days
Job Retention = 6 months AutoPrune = yes }
the script builds the tunnel succesfull (but only with using start-stop-daemon, nohup doesn't work...), but i get the following messages on the director:
18-Mar 15:49 local-backupserver: No prior Full backup Job record found. 18-Mar 15:49 local-backupserver: No prior or suitable Full backup found. Doing FULL backup. 18-Mar 15:49 local-backupserver: Start Backup JobId 39, Job=srv-remote.2005-03-18_15.49.17 18-Mar 15:48 srv-remote: srv-remote.2005-03-18_15.49.17 Fatal error: Failed to connect to Storage daemon: local-backupserver:9103 18-Mar 15:48 srv-remote: srv-remote.2005-03-18_15.49.17 Error: ..\lib \../../lib/bnet.c:685 gethostbyname() for host "local-backupserver" failed: ERR=Authoritative answer for host not found. 18-Mar 15:49 local-backupserver: srv-remote.2005-03-18_15.49.17 Fatal error: Socket error from Filed on Storage command: ERR=No data available
hm. which application want's to connect to the bacula-sd which is running at the same machine as the director (local-bachupserver:9103):
the director or the bacula-fd on the remote w2k server to which the director connects via the ssh tunnel?
on the w2k server the name local-backupserver is not known nor kan the bacula-sd be reached through the (2) firewalls, one local and one remote...
how can i setup a backup system to a remote system with ssh tunnels? or is this not possible with bacula?
thx for any hint,
Chris
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15/03/2005
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users