ShotokanZH / WordpressBK

Automatic wordpress backupper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WordpressBK

Automatic wordpress backupper

How to make it work

  • Edit wp_path,bk_path,sh_user variables according to your system.

    • Example:
      • wp_path="www";
      • bk_path="backup";
      • sh_user="shotokan";
    • Meaning:
      • The user is the shell user "shotokan" (as found in /etc/passwd)
      • The wp_path variable is the variable telling WHERE the worpdress install is located. Accepts relative & absolute paths. If relative, starts from the home of sh_user, so in this case, having home="/home/shotokan/" and wp_path="www" the absolute path will be /home/shotokan/www/
      • bk_path follows the same rules as wp_path, and it's the location of the backup directory.
  • chmod +x wordpressbk.sh

  • Run it (as root) via ./wordpressbk.sh or have it added to crontab (once per day)

  • Protip: you can set the variables like so, so you can script the backup of many wordpress installs via ARG

    • wp_path="$1";
    • bk_path="$2";
    • sh_user="$3";
  • Example: ./wordpressbk.sh www backup shotokan

Note:

Every backup is compressed in a zip named after the current day (if monday: "1-Monday.zip") and the script will automatically replace the files every week.

About

Automatic wordpress backupper

License:GNU General Public License v2.0


Languages

Language:Shell 100.0%