GithubHelp home page GithubHelp logo

shell-scripts's Introduction

Utility Shell Scripts

A collection of shells scripts for doing routine stuff on the command line.

Overview

Script Description
ddev-drupalcreate.sh Moved to GitHub: dale42/ddev-scripts
dropalltables Drop all tables in a database
photo-rename-convert.sh Put HIEC and MOV files in directory based on creation date and create JPG version
restore-db.sh Restore a sql dump file, compresses or uncompressed, to a database
website-backup.sh Database and file backup of a Drupal or WordPress website

dropalltables

Drop all the tables in the specified database.

Usage:

dropalalltables username password database

Notes:

  • Assumes the host is localhost
  • This will leave the database password on the command line history. If this is a concern, use the history -c command to clear thie history, or use the technique described in this stackoverflow article: Execute command without keeping it in history

photo-rename-convert.sh

Process images files in a directory renaming and organizing them based on their creation date, and create jpg versions of HEIC files. This is intended for use on files transferred from an iPhone.

Usage:

photo-rename-convert.sh

Notes:

For each file in the current directory do the following:

  • If the file extension is .heic or .mov, move the file to a directory named {creation-date}/original, where creation-date is the creation date of the file
    e.g. 2023-05-14/original
  • If the file has any other extension, move the file to a directory named {creation-date}, where creation-date is the creation date of the file
  • If the file extension is .heic, create a .jpg version of the file in the {creation-date} directory at its current size and at a width of 1024 pixels

restore-db.sh

Restores a sqldump or gzipped sqldump file to the specified database.

restore-db.sh username password database sql-file.sql

Notes:

  • Assumes the host is localhost
  • This will leave the database password on the command line history. If this is a concern, use the history -c command to clear thie history, or use the technique described in this stackoverflow article: Execute command without keeping it in history

website-backup.sh

A general purpose script for taking a database, file, or database and file backup of a Drupal or WordPress website. It autodetects the CMS and extracts the database credentials from the appropriate settings file.

Usage:

website-backup.sh site-directory [db|file|full] [output-name-root] [output-directory]

Notes:

  • The Drupal settings.php file parse for database credentials is fragile. It currently assumes the settings file is in the sites/default directory.

shell-scripts's People

Contributors

dale42 avatar

Watchers

 avatar James Cloos 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.