Andrew Fletcher published: 13 January 2022 (updated) 6 August 2023 2 minutes read
This page will be a progressive outline of moving those regular run scripts that really need to be automated. Or triggered by a keyword.
These scripts are rsync commands
The initial scripts
production environment
sudo rsync -aur staging/{project}/config drupal cd drupal sudo chown -R www-data:www-data config cd .. sudo rsync -aur staging/{project}/core drupal cd drupal sudo chown -R www-data:www-data core cd .. sudo rsync -aur staging/{project}/modules drupal cd drupal sudo chown -R www-data:www-data modules cd .. sudo rsync -aur staging/{project}/themes drupal cd drupal sudo chown -R www-data:www-data themes cd .. sudo rsync -aur staging/{project}/vendor drupal cd drupal sudo chown -R www-data:www-data vendor cd .. sudo rsync -auv staging/{project}/autoload.php drupal sudo rsync -auv staging/{project}/composer.json drupal sudo rsync -auv staging/{project}/composer.lock drupal sudo rsync -auv staging/{project}/index.php drupal sudo rsync -auv staging/{project}/robots.txt drupal sudo rsync -auv staging/{project}/update.php drupal sudo rsync -auv staging/{project}/web.config drupal cd drupal sudo chown www-data:www-data autoload.php sudo chown www-data:www-data composer.json sudo chown www-data:www-data composer.lock sudo chown www-data:www-data index.php sudo chown www-data:www-data robots.txt sudo chown www-data:www-data update.php sudo chown www-data:www-data web.config cd ..
OR moving production to tmp as a source of back up
sudo rsync -aurv drupal/config tmp/{project} sudo rsync -aurv drupal/core tmp/{project} sudo rsync -aurv drupal/libraries tmp/{project} sudo rsync -aurv drupal/modules tmp/{project} sudo rsync -aurv drupal/themes tmp/{project} sudo rsync -aurv drupal/vendor tmp/{project} sudo rsync -aurv drupal/sites tmp/{project} sudo rsync -auv drupal/autoload.php tmp/{project} sudo rsync -auv drupal/composer.json tmp/{project} sudo rsync -auv drupal/composer.lock tmp/{project} sudo rsync -auv drupal/index.php tmp/{project} sudo rsync -auv drupal/robots.txt tmp/{project} sudo rsync -auv drupal/update.php tmp/{project} sudo rsync -auv drupal/web.config tmp/{project} cd tmp/{project} sudo chown -R www-data:www-data config sudo chown -R www-data:www-data core sudo chown -R www-data:www-data libraries sudo chown -R www-data:www-data modules sudo chown -R www-data:www-data sites sudo chown -R www-data:www-data themes sudo chown -R www-data:www-data vendor sudo chown www-data:www-data autoload.php sudo chown www-data:www-data composer.json sudo chown www-data:www-data composer.lock sudo chown www-data:www-data index.php sudo chown www-data:www-data robots.txt sudo chown www-data:www-data update.php sudo chown www-data:www-data web.config cd ../..
Related articles
Andrew Fletcher
•
21 Apr 2024
This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size...
Andrew Fletcher
•
05 Apr 2024
Drupal 9 to 10 upgrade an example of the actual steps taken
Continuing on from the Drupal 9 to Drupal 10 upgrade outline written earlier... Upgrading Drupal 9 to Drupal 10. However, the point of difference is this article works through the actual action steps of the upgrade.Planning and testing is critical for the Drupal to version 10 process to...
Andrew Fletcher
•
18 Mar 2024
Resolving CVE-2022-48624 less issue
To resolve the CVE-2022-48624 vulnerability on Ubuntu using Nginx, it's crucial to understand that the issue lies within the "less" package, not Nginx itself. The vulnerability affects "less" before version 606, where close_altfile in filename.c in less omits shell_quote calls for LESSCLOSE,...