Skip to content

Instantly share code, notes, and snippets.

@daliborgogic daliborgogic/crontab
Last active Jul 18, 2019

What would you like to do?
Syncs directories and S3 prefixes. Recursively copies new and updated files from the source directory to the destination.
*/10 * * * * /home/dlbr/documents/scripts/ >> /home/dlbr/documents/logs/s3sync.log 2>&1
/usr/local/bin/aws s3 sync
| /home/dlbr/
| s3://dlbr/
# Displays the operations that would be performed using the specified
# command without actually running them.
# | --dryrun
| --endpoint ""
# (string) Exclude all files or objects from the command that matches
# the specified pattern.
| --exclude "*"
# (string) Don't exclude files or objects in the command that match
# the specified pattern.
| --include "apps/*"
| --include "backups/*"
| --include "desktop/*"
| --include "documents/*"
| --include "music/*"
| --include "pictures/*"
| --include "templates/*"
| --include "videos/*"
# (boolean) When syncing from S3 to local, same-sized items will be ignored only
# when the timestamps match exactly. The default behavior is to ignore
# same-sized items unless the local version is newer than the S3 version.
# | --exact-timestamps
# (boolean) Makes the size of each key the only criteria used to decide whether
# to sync from source to destination.
# | --size-only
# (boolean) Delete files that exist in the destination but not in the source are deleted
# during sync.
| --delete

This comment has been minimized.

Copy link
Owner Author

daliborgogic commented Jul 17, 2019

# Make the script executable
$ chmod -x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.