Coder Social home page Coder Social logo

maintenance's Introduction

Maintenance

Maintenance script to backup, update and get server status

This script does the folliwing actions
  • Backup of web server
  • Backup of MySQL database
  • System's update
  • Check for website status

Usage

start
sudo sh maintenance.sh start

status
sudo sh maintenance.sh status

stop
sudo sh maintenance.sh stop

If you prefer, you can turn it into a service
  • Debian
    mv maintenance.sh maintenance && sudo mv maintenance /etc/init.d/
    service maintenance start

  • CentOS

  1. create a file called maintenance.service
    touch maintenance.service

  2. edit the file as below
    vim maintenance.service

[Unit]
Description=Maintenance script to backup, update system and retrieve website status

[Service]
Type=simple
ExecStart=/bin/bash /opt/maintenance start
ExecReload=/bin/bash /opt/maintenance reload
ExecStop=/bin/bash /opt/maintenance stop
PIDFile=/var/run/maintenance.pid

[Install]
WantedBy=multi-user.target
  1. chmod to 644
    chmod 644 maintenance.service

  2. move the files
    mv maintenance.sh maintenance && sudo mv maintenance /opt/
    sudo mv maintenance.service /usr/lib/systemd/system/

  3. reboot your system to apply the changes
    reboot

  4. start the script
    systemctl start maintenance

  5. install
    sudo systemctl enable maintenance

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.