Cannot use finalize_recording_script_path script on jibri

Hey there.,
i set the finalize_recording_script_path but it’s not working why ?

“recording_directory”: “/home/recordings”,
// The path to the script which will be run on completed recordings
“finalize_recording_script_path”: “/home/rclone_s3_upload.sh”,

rclone_s3_upload.sh
!/bin/bash

RECORDINGS_DIR="/home/recordings"

Find latest modified directory

_lastdir=$(find $RECORDINGS_DIR -mindepth 1 -maxdepth 1 -type d -exec stat --printf="%Y\t%n\n" {} ; | sort -n -r | head -1 | cut -f2)

#mv /mnt/HC/recordings/(date +%Y-%m-%d_%H:%M)/*.mp4 /mnt/HC/recordings/ /usr/bin/rclone copy _lastdir remote:****/recording/ -v --log-file=/var/log/jitsi/jibri/jitsi_s3_upload.log

exit 0

i run that script manually it’s working and file stored in s3 but., if i record and stop recording this script not working !! Kindly HELP ME !

i set the permission also that file…
sudo chown jibri:jitsi /home/rclone_s3_upload.sh

atlast i restart the jibri server also but it’s not working

Check the logs in /var/log/jitsi/jibri/

No need to search for the latest modified folder. it’s the first param

_lastdir=$1

Did you run it as the jibri user or someone else…?

Jibri user means ? i setup jibri in my instance and create the sh file linked into jibri config but it’s not running while stop my recording

sudo su -l jibri
whoami

Thanks it’s working