diff options
| author | Robert Massaioli <rmassaioli@atlassian.com> | 2024-10-14 09:03:14 +1100 |
|---|---|---|
| committer | Robert Massaioli <rmassaioli@atlassian.com> | 2024-10-14 09:03:14 +1100 |
| commit | 3e68275ca3e72895c7af53d788eaa4e8d2c9889c (patch) | |
| tree | 906464f4d488d652ebcfcf20e094dfe223949867 /util | |
| parent | a7cb6d15c29e5e3936c7b77b6afaeab616be8940 (diff) | |
Uploaded useful scripts to help manage servers.
Diffstat (limited to 'util')
| -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 |
