-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi!
On 11/17/2005 09:16 PM, Kern Sibbald wrote: > A kludge, which I don't like much, would be to move the definition of Pool > into the common part of the jcr. Hmm - isn't it dangerous and error-prone anyways to have different definitions of JCR in lib, director daemon, file daemon and storage daemon and pass e.g. director jcr objects to methods in lib (and the other way around)? OK, the definition of the daemon-specific attributes (data members) comes at the end of the class definition but I believe that it can be potentially dangerous if the caller (e.g. do_backup_init() in the director) has a different view of the object than the called function (e.g. edit_job_codes() in libbac). Taken from the O'Reilly book "Linux Device Drivers": - -------------------- snipp! -------------------- Another issue related to alignment is portability of data structures across platforms. The same data structure (as defined in the C-language source file) can be compiled differently on different platforms. The compiler arranges structure fields to be aligned according to conventions that differ from platform to platform. At least in theory, the compiler can even reorder structure fields in order to optimize memory usage. - -------------------- snipp! -------------------- I haven't found a similar abstract about c++ member alignment but at least padding is also done when aligning c++ class members. Recapitulationg I believe that it would be much more portable and a much cleaner coding style to have all parts of baculas code use the same class definitions. If there is a common subset of data members that is used by all daemons and a daemon specific part, inheritance (specialization) should be used, the daemon's job control records should inherit from an abstract class that defines the common part. See http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)#Specialization > A much better solution, would be to enhance the Python scripting interface to > include all the variables you want. Most likely all except %s (Since) are > implemented, so it wouldn't be very hard. See src/dird/pythondir.c (if I > remember the name correctly), then just duplicate the code necessary. > Since Python can already submit a run command, the rest should be rather easy > and in the long run, much more powerful. I planned to use the python interface anyways so I'll take a look into that, thanks! Cheers, - --leo > On Thursday 17 November 2005 17:16, Alexander Bergolth wrote: > >>Hi! >> >>I'd like to use the new Run-directive in the Job Resource to define a >>job that should be run after the main backup-job. (This job should >>backup the bacula database directory and is called BackupCatalog.) >> >>However, since my schedule uses daily incremental backups that go to a >>"PoolDaily" during the week, weekly full backups that go to "PoolWeekly" >>and monthly full backups that go to "PoolMonthly", I'd like to specify >>the BackupCatalog-Job to use the same pool as the main backup job and >>hence use the same tape. >> >>I'd like to use a variable like "%p" that is substituted for the pool, >>that the current job is using, to allow starting the BackupCatalog-job >>like that: >> >>Job { >> Name = "Samba-Homes" >> Schedule = "WeeklyCycle" >>[...] >> Run = "BackupCatalog level=%l since=\"%s\" storage=DLT1 pool=%p" >>} >> >>I've found out that "%v" is substituted by the volume-name in >>edit_job_codes() (in lib/util.c) but it looks like there is no variable >>for the pool. >> >>So I tried to add this feature using the attached patch. >>However, it doesn't compile because the pool attribute is only compiled >>into the class JCR, if DIRECTOR_DAEMON is defined. (See jcr.h) >>Unfortunately, when lib/util.c is compiled, DIRECTOR_DAEMON isn't >>defined. So jcr->pool isn't available at compile time in >>edit_job_codes(). However, since jcr is passed from is passed from >>do_backup_init() in dird/backup.c, it should be available at run-time. >> >>I'd appreciate any hint at how to solve the problem... >> >>Cheers, >>--leo - -- - ----------------------------------------------------------------------- [EMAIL PROTECTED] Fax: +43-1-31336-906050 Zentrum fuer Informatikdienste - Wirtschaftsuniversitaet Wien - Austria -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFDfdZJsYaksEkoAQMRAud/AJ44ZLvZYA9nBuO7Rt5evmZi0xLBfwCfVuPw GMiffQhytH7PLzxZaDF/ToQ= =ZMs/ -----END PGP SIGNATURE----- ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users