Commit a8923969 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Añade parámetro de exclusión de rutas

parent 9f9d6667
Loading
Loading
Loading
Loading

.gitignore

deleted100644 → 0
+0 −0

Empty file deleted.

+16 −15
Original line number Diff line number Diff line
@@ -19,10 +19,11 @@ Also sends metrics to Prometheus through Pushgateway.
## Variables

|         Name          |                    Description                    |        Default       |
|-----------------------|-------------------------------------------------|----------------------|
|-----------------------|---------------------------------------------------|----------------------|
| BACKUP_VOL_NAME       | Docker volume name to mount as source             |                      |
| BACKUP_PATH           | Root path to find paths to backup                 | /backup              |
| PATHS_TO_BACKUP       | Paths to include in backup (separated by space)   |                      |
| PATHS_TO_EXCLUDE      | Paths to exclude from backup (separated by space) |                      |
| WORK_PATH             | Temporal path for working                         | /tmp/backup          |
| UPLOAD_BUCKET         | Bucket name for uploads                           | backup-files         |
| UPLOAD_ENDPOINT_URL   | URL for uploads (S3-compatible)                   |                      |
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ services:
    environment:
      BACKUP_PATH:
      PATHS_TO_BACKUP:
      PATHS_TO_EXCLUDE:
      WORK_PATH:
      UPLOAD_BUCKET:
      UPLOAD_ENDPOINT_URL:
+10 −1
Original line number Diff line number Diff line
@@ -79,7 +79,16 @@ function create_compressed() {
	echo "Creating backup"
	local startSeconds=${SECONDS}

	tar -czf ${WORK_PATH}/${compressedFilename} ${PATHS_TO_BACKUP}
	excludeParams=""
	if [ ! -z "${PATHS_TO_EXCLUDE}" ]
	then
		for pathToExclude in ${PATHS_TO_EXCLUDE}
		do
			excludeParams="${excludeParams} --exclude ${pathToExclude}"
		done
	fi

	tar -czf ${WORK_PATH}/${compressedFilename} ${excludeParams} ${PATHS_TO_BACKUP}

	compressDurationSeconds=$(( SECONDS - startSeconds ))
	compressedSize=$(get_size "${WORK_PATH}/${compressedFilename}")