#!/bin/bash

# Navigate to /var/www/photoaman/photoaman/storage/app/gallery
cd /var/www/photoaman/photoaman/storage/app/public/gallery || {
    echo "Failed to navigate to directory"
    exit 1
}

# Remove gallery.zip if it exists
rm -f gallery.zip || {
    echo "gallery.zip could not be removed. Skipping zip creation."
    exit 0
}

# Create a new gallery.zip and add files to it
ls -lt | head -n 50 | awk '{print $9}' | xargs zip gallery.zip

