Voici les scripts que j'utilise. Ils sont bien sur à adapter dans la partie du début qui est la configuration finalement.
#!/bin/sh
set -e
LIBRARY_PATH="${HOME}/Library/Application Support/minecraft/saves"
SAVE_PATH="${HOME}/minecraft_saves/"
SAVE_PREFIX=$(date +"%Y%m%d%H%M%s")
[ -d "${LIBRARY_PATH}" ] || {
echo "Configure library path into header's script"
exit 1
}
[ -d "${SAVE_PATH}" ] || {
echo "Configure save path into header's script"
exit 1
}
cd "${LIBRARY_PATH}"
echo "Let's go..."
tar -czvf "${SAVE_PATH}/${SAVE_PREFIX}.tar.gz" .
echo "Done."
#!/bin/sh
set -e
shopt -s extglob
LIBRARY_PATH="${HOME}/Library/Application Support/minecraft/saves"
SAVE_PATH="${HOME}/minecraft_saves/"
CURRENT_VERSION="201106132218_library.tar.gz"
OLD_VERSION="minecraft_1_5_0_2_library.tar.gz"
MINECRAFT_JAR="Library/Application Support/minecraft/bin/minecraft.jar"
[ -d "${LIBRARY_PATH}" ] || {
echo "Configure library path into header's script"
exit 1
}
[ -d "${SAVE_PATH}" ] || {
echo "configure save path into header's script"
exit 1
}
[ -f "${SAVE_PATH}/${CURRENT_VERSION}" ] || {
echo "configure current version into header's script"
exit 1
}
[ -f "${SAVE_PATH}/${OLD_VERSION}" ] || {
echo "configure old version into header's script"
exit 1
}
[ -z "${1}" -o -n "${1/+(old|new)}" ] && {
echo "Usage: $0 [old|new]"
exit 1
}
echo "Let's go to $1 version ..."
cd ~
case $1 in
old) CHOICE=${OLD_VERSION} ;;
new) CHOICE=${CURRENT_VERSION} ;;
esac
tar -xzf "${SAVE_PATH}/${CHOICE}" "${MINECRAFT_JAR}"
echo "Done."
Que le citron soit pressé ou qu'il vente, il jute.