Last active
January 31, 2016 02:09
-
-
Save enoch85/c683de8ef534bdd81946 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TODAY=`date +"%Y%m%d"` | |
OLD=`date -d "1 days ago" +"%Y%m%d"` | |
OLD2=`date -d "10 days ago" +"%Y%m%d"` | |
USER=enoch | |
UPLOAD_DIR="/var/www/owncloud/data/$USER/files/Projekt/GITHUB_MAIL" | |
# Clone Mail master | |
git clone https://github.com/owncloud/mail.git | |
# Install PHP/JS Dependencies | |
cd mail | |
make | |
cd .. | |
# Move .zip archive to the shared folder in ownCloud | |
mv mail/build/artifacts/appstore/mail.tar.gz $UPLOAD_DIR/owncloud_mail_nightly_build_$TODAY.tar.gz | |
# Cleanup | |
rm -rf mail | |
mv $UPLOAD_DIR/owncloud_mail_nightly_build_$OLD.tar.gz $UPLOAD_DIR/OLD_NIGHTLIES/owncloud_mail_nightly_build_$OLD.tar.gz | |
rm $UPLOAD_DIR/OLD_NIGHTLIES/owncloud_mail_nightly_build_$OLD2.tar.gz | |
# Set correct permissions to zip file | |
bash /var/scripts/setup_secure_permissions_owncloud.sh | |
# Rescan files with .occ | |
sudo -u www-data php /var/www/owncloud/occ files:scan -p $USER/files/Projekt/GITHUB_MAIL/ | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment