Git Product home page Git Product logo

pkharsimran / external_mount_script Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 11 KB

This repository hosts a simple, yet efficient bash script designed to automate the process of mounting a specific partition to a designated folder on an Ubuntu-based system. The script is optimized for running as cron jobs, ensuring reliability and hands-free operation.

Home Page: https://www.harsim.ca/How-to-Set-Up-a-Raspberry-Pi-as-a-Torrenting-VPN-Server-with-Transmission/

Shell 100.00%
bash mount scripts check-mount-check-confirmation-message readme-with-usage-instructions check-confirmation-message existence-check-mount unix-based-system

external_mount_script's Introduction

Bash Script for Mounting a Partition

Hello! This is a simple bash script I wrote for mounting a specific partition to a designated folder. It was designed to run on an Linux system and was optimized for running as a cron job.

How it Works

The script operates by performing the following steps:

  1. Checking if the designated partition exists.
  2. Checking if the partition is already mounted.
  3. Ensuring the target mount folder exists, and creating it if necessary.
  4. Attempting to mount the partition to the specified folder.
  5. Providing feedback on the success or failure of these operations through a log file.

The paths to echo, grep, mkdir, and mount commands are explicitly specified to ensure reliability when the script is run as a cron job.

Usage

  1. Clone the repository containing the script.

  2. Open the script with a text editor and set the PARTITION, MOUNT_FOLDER, and LOG_FILE variables to suit your needs.

  3. Save and close the script.

  4. Set the script to be executable by running chmod +x ./Mount.sh from the command line.

  5. Test the script by running ./Mount.sh from the command line.

  6. If the script runs without errors, you can add it to your crontab for automatic execution at your preferred intervals.

Warning

This script is intended to be run with root privileges due to the use of the mount command. Please be aware that running scripts with root privileges can pose a risk if the scripts contain harmful commands. Always review and understand the scripts before running them as root.

Feedback

If you encounter any issues or have any suggestions for improvements, please feel free to open an issue in this repository.

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.