Hi,

2013/1/19 Adrian Reyer <bacula-li...@lihas.de>

> On Fri, Jan 18, 2013 at 04:00:47PM +0200, Florian Heigl wrote:
> > ssh client-to-backup -n bconsole "run a backup for this box and keep
> > sitting until the backup is completed"
>
> Something like this should do the trick:
> echo "run job=XY yes
> wait job=XY" | ssh client-to-backup bconsole
>
> > How do you automate your off-schedule backups?
>

this was what I was looking for! Below for the curious or google's hunger.
I've tested it and it works as it should. I've added a level=Incremental to
it.

+ echo 'run job=Backup-vmid.xenvms.de level=Incremental yes
wait job=Backup-vmid.xenvms.de'
+ bconsole
Connecting to Director xx:9101
1000 OK: xx-dir Version: 5.0.3 (30 August 2010)
Enter a period to cancel a command.
run job=Backup-vmid.xenvms.de level=Incremental yes
Using Catalog "MyCatalog"
Job queued. JobId=7206
You have messages.
wait job=Backup-vmid.xenvms.de
JobId=7206
JobStatus=OK (T)

Now i'm thinking about how to safely wrap around it - I need to respect the
jobs status.
- if it didn't back up successful then my batch should abort, so I need to
squeeze some return code from it.
I think I'll go the really easy way now by screenscraping the JobStatus=OK
from here.
Nothing wrong about it since I'd rather abort on any unexpected situation.

So the question ends with:
echo 'run job=Backup-vmid.xenvms.de level=Incremental yes
wait job=Backup-vmid.xenvms.de' | bconsole | grep 'JobStatus=OK'

Anything goes wrong, I get an according error from the grep.

I thought about skipping the backup if it's not needed, i.e. because the
last ran 2 hours ago.
That part i'll not bother with for now :)

(If you're really picky you'll see I've not yet split out the OS level
backups, thats the really hard part still ;)

Many thanks & Greetings to Stuttgart,
Florian

-- 
the purpose of libvirt is to provide an abstraction layer hiding all xen
features added since 2006 until they were finally understood and copied by
the kvm devs.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to