Last active
August 29, 2015 14:03
-
-
Save renekreijveld/e7b13bd31126f6514a93 to your computer and use it in GitHub Desktop.
Find Joomla instances and backup them
This file contains 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/sh | |
# sitesbackup -- Find Joomla instances and backup them | |
# Supports all Joomla versions | |
# Requires jbackupstore script | |
# | |
# Backups older than 5 days are automatically cleaned | |
# | |
# Copyright 2014 Rene Kreijveld - [email protected] | |
# | |
# This program is free software; you may redistribute it and/or modify it. | |
# define variables | |
STARTDIR="/home" | |
STOREPATH=/backups/sites | |
JBACKUPSTORE=/usr/local/sbin/jbackupstore | |
LOGFILE=/usr/local/sbin/sitesbackup.log | |
for dir in `find $STARTDIR -maxdepth 4 -type d -name "public_html"`; do | |
if [ -f $dir/configuration.php ]; then | |
# possible joomla found | |
cd $dir | |
echo "`date` Joomla found in $dir" >> ${LOGFILE} | |
# Run backup script | |
${JBACKUPSTORE} | |
fi | |
done | |
# cleanup backups older than 5 days | |
cd ${STOREPATH} | |
find . -mtime +5 -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment