Post_full_imagebackup doesn't seem to fire

I created the script below so I can have a current_Image_PARTITION for each backup. The goal here is to give myself a single point I can reference for an rsync script for the latest monthly backup. The script doesn’t seem to fire after a full backup. It’s a very primitive script (waiting to refine it). There is nothing in the logs either for success or failure. I assume it’s in the correct place as that’s where the backupfolder configuration is stored on this box (Ubuntu 22.04).

root@fre05:/etc/urbackup# ls -la
total 24
drwxr-xr-x   2 root root  4096 Mar  9 19:54 .
drwxr-xr-x 111 root root 12288 Mar  2 06:31 ..
-rw-r--r--   1 root root     8 Jan 17  2023 backupfolder
-rwxr-xr-x   1 root root   224 Mar  9 19:54 post_full_imagebackup
root@fre05:/etc/urbackup# cat post_full_imagebackup
#!/bin/bash


if [ "$3" = "1" ]; then
        BACKUPDIR='/backup'
        HOSTDIR=`echo $1 | cut -d/ -f3`
        #echo $1
        #echo $BACKUPDIR/$HOSTDIR/current_Image_$2
        ln -sfn $1 $BACKUPDIR/$HOSTDIR/current_Image_$2

fi

exit 0

Any help would be greatly appreciated.

Well that was quick. I’ve been staring at this for hours now and nothing is working, then I re-read the documentation and on clients it’s /etc/urbackup, on servers it’s /var/backup. It works now after moving the script.

Now that I see it’s working, I can also see the error in my initial script (not error, but lack of understanding of $1 data that’s passed. $1 is the path to the .raw file, not the folder. I need the path to the folder. I have tweaked the script for anyone else that might need the same thing.

Now I can script the retrieval of /backup/host/current_Image* to get what I need.

#!/bin/bash


if [ "$3" = "1" ]; then
        BACKUPDIR='/backup'
        HOSTDIR=`echo $1 | cut -d/ -f3`
        CURRENTDIR=`echo $1 | cut -d/ -f4`
        #echo $1
        #echo $BACKUPDIR/$HOSTDIR/current_Image_$2
        ln -sfn $BACKUPDIR/$HOSTDIR/$CURRENTDIR $BACKUPDIR/$HOSTDIR/current_Image_$2

fi

exit 0