Heh. I had started a reply about symlinks, but decided you wouldn't be doing that just for a trial, and inferred mysql was empty on your test restore. :)
Dar does not follow symlinks to directories out of its root path (which for this script is $SYNC_DIR). You will have to change the script to point to any other directories you want in the dar. I would suggest the following changes:
1) Create a new DAR_OPTS options line near the top of the script, right under RSYNC_OPTS:
Note the lack of a leading slash for the -g directories. All paths are relative to the -R root. You will have to use / for dar root, if you want to get it all in one go. The side effect of this is that the path of the files within the dar will be different from the script default. In a dar -l listing, instead of (scroll to right)Code:RSYNC_OPTS="-aHK --delete --stats --exclude=*.pid" # leave these unless you are sure you need something else
DAR_OPTS="-R / -g path/to/SYNC_DIR -g path/to/store -g path/to/db"
Assuming /backup/sync is your SYNC_DIR, you will see (scroll to right)Code:[Saved] [-----] drwxrwxr-x 501 zimbra 0 Thu Aug 4 15:02:10 2011 logger
[Saved] [-----] drwxr-xr-x zimbra zimbra 0 Thu Aug 4 15:02:10 2011 logger/db
[Saved] [-----] drwxrwxr-x zimbra zimbra 0 Sun Mar 25 04:04:09 2012 logger/db/data
Notice that SYNC_DIR precedes the rest of the path, using this modification. Similarly, the store and db directories would have a path relative to / and not /opt/zimbra. For that reason, on restores you should be positive that your restore destination is NOT / if you do not want to overwrite an existing SYNC_DIR, db, and store.Code:[Saved] [-----] drwxrwxr-x 501 zimbra 0 Thu Aug 4 15:02:10 2011 backup/sync/logger
[Saved] [-----] drwxr-xr-x zimbra zimbra 0 Thu Aug 4 15:02:10 2011 backup/sync/logger/db
[Saved] [-----] drwxrwxr-x zimbra zimbra 0 Sun Mar 25 04:04:09 2012 backup/sync/logger/db/data
2) You will also need to remove the "-R `pwd`" root setting at the 4 places in the script where $DAR_BIN -c gets called, and add $DAR_OPTS to the command:
Or, skip DAR_OPTS and just make all the changes in all 4 places:Code:nice -19 $DAR_BIN $DAR_OPTS -K bf:$KEY -s $ARCHIVESIZE -z$COMPRESS -Z "*.gz" -Z "*.zip"\
-Z "*.bz2" -Z "*.tgz" -Z "*.zgz" -Z "*.jar" -Z "*.tiff" \
-Z "*.jpg" -Z "*.png" -Z "*.gif" -Z "*.jpeg" \
-c "$ARCHIVEDIR""$ARCHIVENAME" -Q
I know that tar can follow symlinks, but that has its own complications.Code:nice -19 $DAR_BIN -K bf:$KEY -s $ARCHIVESIZE -z$COMPRESS -Z "*.gz" -Z "*.zip"\
-Z "*.bz2" -Z "*.tgz" -Z "*.zgz" -Z "*.jar" -Z "*.tiff" \
-Z "*.jpg" -Z "*.png" -Z "*.gif" -Z "*.jpeg" -R "/" \
-g "path/to/SYNC_DIR" -g "path/to/db" -g "/path/to/store" \
-c "$ARCHIVEDIR""$ARCHIVENAME" -Q

