diff options
| author | m-chandler <mchandler89@gmail.com> | 2024-10-14 08:35:58 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-14 08:35:58 +1000 |
| commit | 9ad64993477c849da2e487b0c8c3034ff9eadb88 (patch) | |
| tree | 3c6b1029073547e962761f7ce94d1ebb5dded2ce /util/delete-filesystems.bash | |
| parent | fe59339df077f7c4a02aad744ff136e57ae60176 (diff) | |
| parent | 3e68275ca3e72895c7af53d788eaa4e8d2c9889c (diff) | |
Merge pull request #36 from robertmassaioli/bring-in-utility-scripts
Bring in utility scripts
Diffstat (limited to 'util/delete-filesystems.bash')
| -rw-r--r-- | util/delete-filesystems.bash | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/util/delete-filesystems.bash b/util/delete-filesystems.bash new file mode 100644 index 0000000..dc5bbbd --- /dev/null +++ b/util/delete-filesystems.bash @@ -0,0 +1,17 @@ +# Get all of the filesystems to delete +# aws efs describe-file-systems --query "FileSystems[?Name!=null]|[?starts_with(Name, 'factorio-')].FileSystemId" --output text | cat + +# For each filesystem whose name starts with "factorio-" delete it. +# This is a very very dangerous script. Only use it if you know what you are doing. +# I recommend you download your save files first using download-latest-save.bash + +for fs_id in $(aws efs describe-file-systems --query "FileSystems[?Name!=null]|[?starts_with(Name, 'factorio-')].FileSystemId" --output text | cat) +do + echo "Deleting file system: $fs_id" + aws efs delete-file-system --file-system-id $fs_id + if [ $? -eq 0 ]; then + echo "Successfully deleted file system: $fs_id" + else + echo "Failed to delete file system: $fs_id" + fi +done
\ No newline at end of file |
