Skip to content

Scripts to set up for cron backups on remote servers and scripts to pull down those backups to local.

Notifications You must be signed in to change notification settings

cbfannin/bkp-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SET UP

  1. Make a copy of the bkp-script.sh file and place it in to the mybkps directory with a name that relfects your project. cp bkp-script.sh mybkps/myproject.sh
  2. Change in to the mybkps directory. cd mybkps
  3. Edit the newly copied script file adding all the required variables.
  4. Source the script or start a new terminal so the script will be recognized. source ./myproject.sh

RUN
While in your mybkps directory Run ./myproject

IMPORT
If all worked according to plan, you should now have the most recent database and files backup in your project's root directory on your local machine. From your project's root directory, you just need to:

  1. Import the database. lando db-import <database-name>
  2. Extract the files. Be sure to replace "filesbkp.tar.gz" with the name of the file backup name you retreived from the remote server. tar -xvf filesbkp.tar.gz -C /web/sites/default/
  3. Clear Cache. drush cache rebuild

CLEANUP
At this point it is OK to remove the downloaded backups. You may keep them incase you bork your local and need to reimport them. Just repeat the IMPORT steps above. If you wish to get rid of the files you can do so by rm database-bkp-name.tar.gz && rm files-bkp-name.tar.gz. Again replace the filenames with the actual filenames you retrieved from the remote server.

About

Scripts to set up for cron backups on remote servers and scripts to pull down those backups to local.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages