Artifactory CIFS/SMB network backup solution
This tool transfers JFrog Artifactory weekly backup from a Linux environment to a CIFS/SMB network share (Windows environment).
The SMB/CIFS protocol is a standard file sharing protocol widely deployed on Microsoft Windows machines.
Keeping a backup of all promoted and/or released artifacts are very useful in case you need to maintain a code base for an extended period of time even decades.
Artifactory can be configured to automatically cleanup old local backups (daily and weekly) so this tools does not implement local cleanup but only remote cleanup.
Weekly backup typically include:
Weekly backup for long-term maintenance projects include:
Weekly backup typically exclude:
Features
/etc/fstab
)CIFS_VERSION
configuration)live-cfg.sh
, see Configuration paramters section.
Minimum install requires:
artifact-backup.sh
,artifact-restore.sh
,common.sh
,live-cfg.sh
(modifiedtemplate-cfg.sh
).
sudo dnf install bash tar cifs-utils crontabs
Artifactory OSS is also technically supported but it does not support promotion.
When running Artifactory in docker you must volume mount backup directory to host.
Create a configuration file called
live-cfg.sh
based on template-cfg.sh
.
CIFS/SMB protocol information from
man mount.cifs
.
Disk space peak usage: (
BACKUP_COUNT
+ 1 ) *backup size
.
You should schedule a daily run of the script to ensure the latest weekly backup is copied to the network share.
Choose a start time that don’t collide with network share backup and machine maintenance window (patches are applied and rebooted).
Call sudo crontab -e
and use examples below as template.
Examples:
The following examples are running daily at 06:00 and this repository artifactory-network-backup
is cloned into /home/devops/anb
.
Run daily with log:
0 6 * * * /home/devops/anb/artifact-backup.sh >> /home/devops/anb/log.txt 2>&1
Run daily without log:
0 6 * * * /home/devops/anb/artifact-backup.sh > /dev/null 2>&1
It’s possible to enable development debug in
artifact-backup.sh
by settingset -x
.
Crontab syntax:
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
crontab guru - The quick and simple editor for cron schedule expressions by Cronitor.
What to help? See CONTRIBUTING.md.
All notable changes to this project will be documented in CHANGELOG.md.
Version string is stored in common.sh.
Interface:
The following items are considered interfaces of this component:
YYYYMMDD.HHMMSS
template-cfg.sh
Major version must be bumped in case any changes breaks the interface.
Travis pipeline:
Test:
You should be able to run ./run_test.sh
and validate that artifact-backup.sh
is working on host machine without doing remote connections.
Documentation: