Skip to content

Commit 5dbc6ed

Browse files
committed
Update backups README
1 parent f3d9ab7 commit 5dbc6ed

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/backups/README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,15 @@ uv run python3 main.py backup-file-metadata
4848
> activate and deactivate the virtual environment manually with
4949
> `source .venv/bin/activate` and `deactivate`, respectively.
5050
51+
> [!TIP]
52+
> If the `request` command is in progress and you have to leave
53+
> causing you to lose internet, you can pause the process on Linux/MacOS
54+
> using `Ctrl + Z` and then resume the process in the foreground with `fg`
55+
> to prevent losing your progress. (This has only been tested on MacOS
56+
> and using Eduroam wifi before and after pausing. Switching networks might not work.)
57+
5158
> [!WARNING]
52-
> OkPy tokens expire within a few hours. If you are in the middle of
59+
> OkPy tokens expire within < 12 hours. If you are in the middle of
5360
> running the `request` command and your token expires, making an API
5461
> request will cause a 401 Forbidden error and then the script will terminate,
5562
> losing all your progress. Therefore, we recommend always getting a fresh
@@ -101,20 +108,20 @@ cd data/private/cal/cs88/fa25/ants
101108
```
102109
1. Run the following command to synchronize the contents of the folder you are currently inside to the folder in our AWS S3 bucket, replacing `$BUCKET_NAME` with your desired bucket and `$FILE_PATH` with your desired path:
103110
```sh
111+
# Regular sync: Upload all files in current directory to destination path in the bucket
104112
aws s3 sync . s3://$BUCKET_NAME/$FILE_PATH
105113

106-
# Example
114+
# Sync + delete: Same as above + delete any files in destination that aren't in current directory
115+
aws s3 sync . s3://$BUCKET_NAME/$FILE_PATH --delete
116+
117+
# Examples
107118
aws s3 sync . s3://ucb-assignment-snapshots-eae254943a2c4f51bef67654e99560dd/cal/cs88/fa25/ants
119+
aws s3 sync . s3://ucb-assignment-snapshots-eae254943a2c4f51bef67654e99560dd/cal/cs88/fa25/ants --delete
108120
```
109121

110122
> [!NOTE]
111123
> We recommend keeping the `$FILE_PATH` the same for steps 1-2 above for consistency, although technically they can differ.
112124
113-
> [!TIP]
114-
> You can pass the `--delete` flag with `aws s3 sync` so that files that
115-
> are in the destination but not in the source are deleted.
116-
> See the [AWS CLI docs](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) for more.
117-
118125
## Dumping database from OkPy Backups CLI into Rails database
119126

120127
1. **Optional if not done already:** Run backups CLI command(s) in this directory to create or update `$OUTPUT_DB_NAME.db`. If you are an internal contributor working with the dev dataset from `data.zip`, skip this step.

0 commit comments

Comments
 (0)