| Server IP : 193.86.120.172 / Your IP : 216.73.216.67 Web Server : Apache/2.4.63 (Unix) System : Linux JServices 3.10.108 #86003 SMP Wed Oct 22 13:20:46 CST 2025 x86_64 User : kubec ( 1026) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/syno/sbin/ |
Upload File : |
#!/bin/bash
. /usr/syno/plugin/volume/mount/SynologVolumeMount.sh
function enumAllVolumes ()
{
/bin/grep normal /run/synostorage/volumetab | /bin/awk '{ print $2 }'
}
function findBestVolume ()
{
local candidate
local db_root_dir="synolog"
if HCIIsSupport; then
db_root_dir="synolog/$(GetSN)"
fi
candidate=$(enumAllVolumes \
| /bin/xargs -n1 -i /bin/sh -c "/bin/stat -c '%Y %n' {}/@database/$db_root_dir/.*XFERDB" 2>/dev/null \
| /bin/sort -k1 -nr \
| /bin/head -n1 \
| /bin/cut -d' ' -f2)
local CANDIDATE_VOLUME
if [[ ${#candidate} -ne 0 ]]; then
CANDIDATE_VOLUME=$(GetVolumePath "$candidate")
fi
if ! IsNormalVol "$CANDIDATE_VOLUME" ;then
CANDIDATE_VOLUME="$(/usr/syno/bin/servicetool --get-available-volume)"
if [ "${CANDIDATE_VOLUME:0:7}" = "/volume" ]; then
/bin/echo -n "${CANDIDATE_VOLUME}"
fi
else
/bin/echo -n "${CANDIDATE_VOLUME}"
fi
}
function createDBLink ()
{
local bestVolume
bestVolume=$(GetVolume "/var/log/synolog/.AFPXFERDB")
if ! IsNormalVol "$bestVolume" ;then
bestVolume=$(findBestVolume)
fi
if [ ! -d "${bestVolume}" ]; then
exit 0
fi
env RESULT=0 MOUNTPOINT="${bestVolume}" LOCATION="INTERNAL" \
/usr/syno/plugin/volume/mount/SynologVolumeMount.sh --post
}
createDBLink