Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Jamin Shanti / Bash

This repository contains a collection of Bash scripts for various tasks, including Bitbucket backups and configuration management.

Table of Contents

Technologies

  • Bash Programming Language: bash

Projects

Bitbucket Backup

The backupbitbucket.sh script automates the process of backing up all repositories from a Bitbucket user account. It clones or pulls the latest changes for each repository and then syncs them to an AWS S3 bucket.

Usage:

./backupbitbucket.sh -u <bitbucketUser> -k <bitbucketapiKey> -p <project_name>

Prerequisites:

  • curl
  • jq
  • git
  • aws CLI configured with appropriate credentials.

Features:

  • Fetches all repositories for a given user.
  • Clones new repositories.
  • Pulls updates for existing repositories.
  • Syncs backups to an S3 bucket.
  • Detailed logging to /archive_workspace/logs/backupbitbucket.log.

Configuration Management

Located in the ConfigurationManagement directory, these scripts provide a simple way to run commands across multiple servers. This is useful for environments where more advanced configuration management tools are not yet deployed.

Structure:

  • Sweep_Servers.sh: The main script that iterates through server lists and executes a command on each server.
  • set_env_serverlist.sh: Defines groups of servers.
  • Sample_Script.sh: The script to be executed on each remote server.

Usage:

  1. Define Server Lists: Edit set_env_serverlist.sh to define your server groups.
  2. Create Script: Edit Sample_Script.sh with the commands you want to run.
  3. Run Sweep: Execute Sweep_Servers.sh.
./Sweep_Servers.sh

Assumption: You must have SSH keys deployed to all target servers. ssh-copy-id is recommended for this.

Sample Output:

-------------------------------
FIRST_SERVERLIST Environment...
-------------------------------
Connecting to server1...
ServerName: server1
Red Hat Enterprise Linux Server release 8.4 (Ootpa)
-------------------------------
Connecting to server2...
ServerName: server2
Ubuntu 20.04.2 LTS
-------------------------------

Contributing

I ♥ contributors!

If you want to contribute to this project, please:

  1. Claim an issue on the Issues tab.
  2. Fork the project.
  3. Create a feature branch.
  4. Submit a pull request.

Guidelines

  • Keep code neat and readable.
  • Ensure scripts are executable and have appropriate shebangs.
  • Test your changes before submitting.

About

Bash scripts for automating Bitbucket backups to S3 and performing agentless configuration management on Linux servers.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages