Skip to content

Commit

Permalink
Release 1.1.1
Browse files Browse the repository at this point in the history
fix(delete-mu-plugins): Fixed example config
fix(delete-mu-plugins): More fixes for paths ;)
fix(delete-mu-plugins): More fixeds to ensure rsync works
  • Loading branch information
jordantrizz committed Jan 22, 2024
1 parent 752a2eb commit bbef4aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.3
1.1.1
5 changes: 3 additions & 2 deletions custom/delete-mu-plugins/delete-mu-plugins.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SOURCE_DIR="/var/www/domain.com/wp-content"
# -- Don't include trailing slashes in SOURCE_DIR or slashes at the beginning of FILES_FOLDERS_DELETE
SOURCE_DIR="/var/www"
BACKUP_DIR="/root/backup"
DOMAIN_LIST=('domain1.com' 'domain2.com' 'domain3.com')
#DOMAIN_LIST="test.com test1.com test2.com"
FILES_FOLDERS_DELETE=('mu-plugins/pluginfile.php' 'plugins/testplugin' 'mu-plugins/test.php')
FILES_FOLDERS_DELETE=('htdocs/wp-content/mu-plugins/pluginfile.php' 'htdocs/wp-content/plugins/testplugin' 'htdocs/wp-content/mu-plugins/test.php')
DRYRUN=1
12 changes: 6 additions & 6 deletions custom/delete-mu-plugins/delete-mu-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ dmp_usage () {
echo ""
echo "Example delete-mu-plugins.conf:"
echo ""
echo "SOURCE_DIR=\"/var/www/domain.com/wp-content/mu-plugins\""
echo "SOURCE_DIR=\"/var/www\""
echo "BACKUP_DIR=\"/root/backup\""
echo "DOMAIN_LIST=('domain1.com' 'domain2.com' 'domain3.com')"
echo "FILES_FOLDERS_DELETE=('mu-plugins/pluginfile.php' 'plugins/testplugin' 'mu-plugins/test.php')"
echo "FILES_FOLDERS_DELETE=('htdocs/wp-content/mu-plugins/pluginfile.php' 'htdocs/wp-content/plugins/testplugin' 'htdocs/wp-content/mu-plugins/test.php')"
echo "DRYRUN=0"
echo ""
echo "Note, DRYRUN is always set as default, so you must set it to 0 to run the script."
Expand Down Expand Up @@ -46,14 +46,14 @@ function move_files () {
if [[ $DRYRUN == "1" ]]; then
echo "- Dry run enabled. Skipping move operation."
for ITEM in "${FILES_FOLDERS_DELETE[@]}"; do
echo "- Processing $DOMAIN and in $SOURCE_DIR/$DOMAIN/$ITEM to $BACKUP_DIR/$DOMAIN/$ITEM"
echo "#> rsync -av --remove-source-files \"$SOURCE_DIR/$DOMAIN/$ITEM\" \"$BACKUP_DIR/$DOMAIN/$ITEM\""
echo "- Processing $DOMAIN and in $SOURCE_DIR/$DOMAIN/$ITEM to $BACKUP_DIR/$SOURCE_DIR/$DOMAIN/$ITEM"
echo "#> rsync -avR --remove-source-files \"$SOURCE_DIR/$DOMAIN/$ITEM\" \"$BACKUP_DIR\""
done
else
for ITEM in "${FILES_FOLDERS_DELETE[@]}"; do
echo "- Processing $DOMAIN and in $SOURCE_DIR/$DOMAIN/$ITEM to $BACKUP_DIR/$DOMAIN/$ITEM"
echo "- Processing $DOMAIN and in $SOURCE_DIR/$DOMAIN/$ITEM to $BACKUP_DIR/$SOURCE_DIR/$DOMAIN/$ITEM"
# -- Use rsync to maintain directory tree
rsync -av --remove-source-files "$SOURCE_DIR/$DOMAIN/$ITEM" "$BACKUP_DIR/$DOMAIN/$ITEM"
rsync -av --remove-source-files "$SOURCE_DIR/$DOMAIN/$ITEM" "$BACKUP_DIR"
done
fi

Expand Down

0 comments on commit bbef4aa

Please sign in to comment.