From 29d994da739219b33475e2f289b9aab9bb2a277b Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 27 Jan 2010 11:36:22 +0100 Subject: [PATCH] Disabled ActionOnPurge waiting for a fix --- bacula/src/dird/ua_purge.c | 3 +++ bacula/src/stored/dircmd.c | 35 +++++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 282853f05c..c031febc12 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -588,6 +588,8 @@ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr) return false; } +/* Code currently disabled */ +#if 0 if (mr->ActionOnPurge > 0) { /* Send the command to truncate the volume after purge. If this feature * is disabled for the specific device, this will be a no-op. @@ -614,6 +616,7 @@ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr) return false; } } +#endif pm_strcpy(jcr->VolumeName, mr->VolumeName); generate_job_event(jcr, "VolumePurged"); diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index fcb8c38d18..c9b74b000f 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -883,23 +883,41 @@ static bool unmount_cmd(JCR *jcr) */ static bool action_on_purge_cmd(JCR *jcr) { - POOL_MEM devname; - POOL_MEM volumename; + char devname[MAX_NAME_LENGTH]; + char volumename[MAX_NAME_LENGTH]; BSOCK *dir = jcr->dir_bsock; DEVICE *dev; DCR *dcr; int action; - devname.check_size(dir->msglen+1); - volumename.check_size(dir->msglen+1); + /* Currently disabled */ + dir->fsend(_("3916 Feature action_on_purge currently disabled\n")); - if (sscanf(dir->msg, "action_on_purge %127s vol=%s action=%d", - devname.c_str(), volumename.c_str(), &action) != 3) { +#if 0 + /* TODO: Need to find a free device and ask for slot to the director */ + if (sscanf(dir->msg, + "action_on_purge %127s vol=%127s action=%d", + devname.c_str(), volumename.c_str(), &action)!= 5) + { dir->fsend(_("3916 Error scanning action_on_purge command\n")); goto done; } - unbash_spaces(volumename.c_str()); - unbash_spaces(devname.c_str()); + unbash_spaces(volumename); + unbash_spaces(devname); + + /* Check if action is correct */ + switch (action) { + case AOP_TRUNCTATE: + break; + default: + dir->fsend(_("3919 Bad ActionOnPurge\n")); + goto done; + } + + /* TODO: Ask for Volume information + * - check recycle + * - find slot + */ /* FIXME: autochanger, drive = 0? how can we avoid that? we only work on * files @@ -921,6 +939,7 @@ static bool action_on_purge_cmd(JCR *jcr) } else { dir->fsend(_("3918 Recycle failed\n")); } +#endif done: dir->signal(BNET_EOD); -- 2.39.5