V3 - The big one #71

Merged
rogs merged 31 commits from v3 into master 2024-12-30 11:01:29 -03:00
Showing only changes of commit ffdb38293b - Show all commits

14
yams
View File

@ -5,11 +5,13 @@ dc="docker compose -f <filename> -f <custom_file_filename>"
install_directory="<install_directory>"
option=${1:-"--help"}
destination=${2:-"."}
destination=$(realpath "$destination")
help() {
echo "yams - Yet Another Media Server"
echo
echo "Usage: yams [--help|restart|stop|start|destroy|check-vpn|update (deprecated)]"
echo "Usage: yams [--help|restart|stop|start|destroy|check-vpn|backup [destination]|update (deprecated)]"
echo "options:"
echo "--help displays this help message"
echo "restart restarts yams services"
@ -17,6 +19,7 @@ help() {
echo "start starts yams services"
echo "destroy destroy yams services so you can start from scratch"
echo "check-vpn checks if the VPN is working as expected"
echo "backup [destination] backs up yams to the destination location"
echo "update updates YAMS (deprecated)"
}
@ -114,3 +117,12 @@ fi
if [ "$option" == "update" ]; then
echo "This command is deprecated. Please update YAMS manually."
fi
if [ "$option" == "backup" ]; then
echo "Backing up YAMS to $destination..."
echo "This may take a while depending on the size of your installation."
echo "Please wait... ⌛"
tar --exclude='transcoding-temp' -cavf $destination/yams-backup-$(date '+%Y-%m-%d-%s').tar.gz $install_directory/
send_success_message "Backup completed successfully! 🎉"
echo "Backup file: $destination/yams-backup-$(date '+%Y-%m-%d-%s').tar.gz"
fi