By default when the Snap package is installed, YaCy data is stored in a versioned user folder, allowing to revert to previous data after a package refresh for example. But it can consumes much disk space, so it is now possible to tell YaCy snap not to version its data, with the Snap configuration setting "data.versioned=false".pull/278/head
parent
811d40a6c4
commit
915080e8d4
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Wrapper script for Snap package specific instructions before calling the bin/passwd.sh script
|
||||
|
||||
# Check the snap configuration to properly fill the YACY_DATA_PATH environment variable
|
||||
DATA_VERSIONED="$(snapctl get data.versioned)"
|
||||
if [ "$DATA_VERSIONED" = "false" ]; then
|
||||
# YaCy data is in the Snap common (non versioned) user data
|
||||
YACY_DATA_PATH="$SNAP_USER_COMMON/DATA"
|
||||
else
|
||||
# Defaults : YaCy data is in the Snap versioned user data
|
||||
YACY_DATA_PATH="$SNAP_USER_DATA/DATA"
|
||||
fi
|
||||
export YACY_DATA_PATH
|
||||
|
||||
sh "$SNAP/yacy/bin/passwd.sh"
|
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Wrapper script for Snap package specific instructions before calling the startYACY.sh script
|
||||
|
||||
# Check the snap configuration to properly fill the YACY_DATA_PATH environment variable
|
||||
echo "*******************************************************************************"
|
||||
DATA_VERSIONED="$(snapctl get data.versioned)"
|
||||
if [ "$DATA_VERSIONED" = "false" ]; then
|
||||
# YaCy data is in the Snap common (non versioned) user data
|
||||
YACY_PARENT_DATA_PATH="$SNAP_USER_COMMON"
|
||||
|
||||
if [ ! -d "$YACY_PARENT_DATA_PATH/DATA" ] && [ -d "$SNAP_USER_DATA/DATA" ]; then
|
||||
if [ -f "$SNAP_USER_DATA/DATA/yacy.running" ]; then
|
||||
echo "**** Warning : can not move YaCy snap data from versioned to non versioned folder as YaCy appears to be already running."
|
||||
else
|
||||
(mv "$SNAP_USER_DATA/DATA" "$YACY_PARENT_DATA_PATH" && \
|
||||
echo "*** YaCy snap data moved from versioned to non versioned snap data." ) \
|
||||
|| echo "**** Warning : could not move YaCy snap data from versioned to non versioned folder."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "** YaCy snap is using non versioned data at $YACY_PARENT_DATA_PATH/DATA"
|
||||
echo "** You can configure it to use snap versioned data with the following command :"
|
||||
echo "** sudo snap set $SNAP_NAME data.versioned=true"
|
||||
else
|
||||
# Defaults : YaCy data is in the Snap versioned user data
|
||||
YACY_PARENT_DATA_PATH="$SNAP_USER_DATA"
|
||||
|
||||
if [ ! -d "$YACY_PARENT_DATA_PATH/DATA" ] && [ -d "$SNAP_USER_COMMON/DATA" ]; then
|
||||
if [ -f "$SNAP_USER_COMMON/DATA/yacy.running" ]; then
|
||||
echo "**** Warning : can not move YaCy snap data from non versioned to versioned folder as YaCy appears to be already running."
|
||||
else
|
||||
(mv "$SNAP_USER_COMMON/DATA" "$YACY_PARENT_DATA_PATH" && \
|
||||
echo "*** YaCy snap data moved from non versioned to versioned snap data." ) \
|
||||
|| echo "**** Warning : could not move YaCy snap data from non versioned to versioned folder."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "** YaCy snap is using versioned data at $YACY_PARENT_DATA_PATH/DATA"
|
||||
echo "** To reduce disk usage, you can configure it to use snap non versioned data with the following command :"
|
||||
echo "** sudo snap set $SNAP_NAME data.versioned=false"
|
||||
fi
|
||||
export YACY_PARENT_DATA_PATH
|
||||
|
||||
sh "$SNAP/yacy/startYACY.sh" -f -s "$YACY_PARENT_DATA_PATH"
|
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Snap configuration hook script
|
||||
# Even if empty, its presence is required to enable the Snap specific "data.versioned" configuration key
|
||||
|
||||
echo "Configuring yacy-search"
|
Loading…
Reference in new issue