Giter Club home page Giter Club logo

simple-automated-tasks's Introduction

Simple Automated Tasks

This is a repo for sharing how I manage automated tasks as part of the series Hosting WordPress Yourself.

Installation

Copy the .tasks directory to your home directory:

.tasks
     - backups.sh
     - checksums.sh
     - cron.sh
     - permissions.sh
     - sites.sh
     - updates.sh
site1.com
     + backups
     + cache
     + logs
     + public
site2.com
     + backups
     + cache
     + logs
     + public
site3.com
     + backups
     + cache
     + logs
     + public

Ensure the bash scripts have execute permissions chmod +x backups.sh checksums.sh cron.sh permissions.sh sites.sh updates.sh.

Update sites.sh with the absolute path to where your site directories reside. Update backups.sh, checksums.sh, cron.sh, permissions.sh and updates.sh with the absolute path of your sites.sh file.

Add each site to the sites.sh config file:

SITES=(
	"site1.com"
	"site2.com"
	"site3.com"
)

Add a cronjob for each individual task crontab -e. The following example will run WordPress cron every 5 minutes, perform backups daily at 4AM, update all themes, plugins and language files at 5AM, update file permissions daily at 6AM and verify checksums at 7AM:

*/5 * * * * cd /home/a5hley/.tasks; bash cron.sh >/dev/null 2>&1
0 4 * * * cd /home/a5hley/.tasks; bash backups.sh >/dev/null 2>&1
0 5 * * * cd /home/a5hley/.tasks; bash updates.sh >/dev/null 2>&1
0 6 * * * cd /home/a5hley/.tasks; bash permissions.sh >/dev/null 2>&1
0 7 * * * cd /home/a5hley/.tasks; bash checksums.sh >/dev/null 2>&1

If you plan on sending backups to S3 you must also install and configure the AWS CLI tools.

The checksums task requires a Pushbullet account, so that notifications are pushed to your computer, IOS or Android devices. Add your Access Token to the checksums.sh file:

TOKEN=mytoken

simple-automated-tasks's People

Contributors

a5hleyrich avatar fabiangigler avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.