Skip to content

refactor sync-to-s3.sh per directory#623

Merged
RobHooper merged 6 commits into
mainfrom
sync-script-refactor
May 14, 2026
Merged

refactor sync-to-s3.sh per directory#623
RobHooper merged 6 commits into
mainfrom
sync-script-refactor

Conversation

@RobHooper
Copy link
Copy Markdown
Contributor

@RobHooper RobHooper commented May 12, 2026

This PR modifies the sync-to-s3.sh to sync one directory rather than many, this allows us to add directory specific features (exclude paths #618) without the feature being applied to all paths.
The main complexity of backing up directories has been moved into Salt creating a cron for each sync path and setting features as required - this should prove more extendable in the future.

Closes #618

Connected tasks:

  • Remove SYNC_DIRECTORIES from settings.local

@RobHooper RobHooper requested a review from jpmckinney May 12, 2026 14:20
@RobHooper RobHooper self-assigned this May 12, 2026
Comment thread salt/aws/files/sync-to-s3.sh
Comment thread salt/aws/sync.sls Outdated
AWS_ARGS=(--only-show-errors --delete)

set +e
$AWS_CLI s3 sync "$DIRECTORY" "s3://$S3_SYNC_BUCKET/$SAFENAME/" --only-show-errors --delete 2>&1 | grep -v "You did not provide the number of bytes specified by the Content-Length HTTP header"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need this anymore?

2>&1 | grep -v "You did not provide the number of bytes specified by the Content-Length HTTP header"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may still want to ignore these alerts (files changing as the script runs).
I want to see how much the exclude functionality reduces these warnings first.

Comment thread salt/aws/files/sync-to-s3.sh Outdated
Comment thread salt/aws/files/sync-to-s3.sh Outdated
Comment thread salt/aws/sync.sls Outdated
RobHooper and others added 3 commits May 14, 2026 11:50
Co-authored-by: James McKinney <26463+jpmckinney@users.noreply.github.com>
@RobHooper RobHooper merged commit 698d338 into main May 14, 2026
12 checks passed
@RobHooper RobHooper deleted the sync-script-refactor branch May 14, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S3 sync: Ignore requests.queue directories

2 participants