Skip to content

Backup all your Bitbucket Repositories with this Shell Script. No extra packages needed.

License

Notifications You must be signed in to change notification settings

efairon/bitbucket-backup

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Bitbucket Backup

Backup all your Bitbucket Repositories with this Shell Script. No extra packages needed.

Features

  • This shell script will do a bare-clone on your all repositries.
  • Backup will be stored on the backloc location specified on the script.
  • You can add a cron on the server for desired interval.
  • We recommemnd Generating App Password which will have only read access to your account

How to Configure

  • Download the latest release from github to the backup server.
cd /usr/local/src && wget https://raw.githubusercontent.com/redhatjobin/bitbucket-backup/master/bitbucket-backup.sh
  • Open the file bitbucket-backup.sh and add the below variables.

    bbuser='Username_here' #Bitbucket USERNAME from https://bitbucket.org/USERNAME/reponame. Email id will not work as username.
      bbpass='password_here'      # Password or App Password
      backloc="/backups/bitbucket" #backup location on this system
      

How to Create an App Password

How to add cron

  • You can run crontab -e command to edit the contab. You can add the cron under any user.
  • The below cron sample will run the backup at 3 AM every day.
 0 3 * * * /usr/local/src/bitbucket-backup.sh

About

Backup all your Bitbucket Repositories with this Shell Script. No extra packages needed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%