[GH-ISSUE #14] syntax error near unexpected token `<' #4

Closed
opened 2026-03-04 19:25:39 +03:00 by kerem · 2 comments
Owner

Originally created by @mpalermo73 on GitHub (Dec 26, 2025).
Original GitHub issue: https://github.com/007revad/Synology_docker_cleanup/issues/14

Hey!

  • Model: DS1019+
    • Upgraded to 16G RAM
  • DSM: 7.3.2-86009
  • Container Manager: 24.0.2-1606

I just found your script and tried running it. I get this error:

-> % sudo sh syno_docker_cleanup.sh
Synology_docker_cleanup v1.2.4

130 total docker btrfs subvolumes found.
syno_docker_cleanup.sh: line 97: syntax error near unexpected token `<'
syno_docker_cleanup.sh: line 97: `readarray -t temp < <(btrfs subvolume list -p /"$volume"/@docker/btrfs/subvolumes)'
-> % sudo ls -1 /volume1/@docker/btrfs/subvolumes | wc -l
130

-> % sudo du -hs /volume1/@docker/btrfs/subvolumes
33G     /volume1/@docker/btrfs/subvolumes

I have subvolumes datting back to March of 2022, but most are much more current. It seems I'm overdue for a cleaning. I don't know what all you need to know though. Myh clone is as new as it gets.

-> % git log -1
commit cdb3154efa96faa0b542e1bc9c4ec4d5c155ceef (HEAD -> main, origin/main, origin/HEAD)
Author: 007revad <39733752+007revad@users.noreply.github.com>
Date:   Thu Dec 18 21:14:51 2025 +1100

Update my-other-scripts.md

Thank you!

Originally created by @mpalermo73 on GitHub (Dec 26, 2025). Original GitHub issue: https://github.com/007revad/Synology_docker_cleanup/issues/14 Hey! - Model: `DS1019+` - Upgraded to 16G RAM - DSM: `7.3.2-86009` - Container Manager: `24.0.2-1606` I just found your script and tried running it. I get this error: ``` -> % sudo sh syno_docker_cleanup.sh Synology_docker_cleanup v1.2.4 130 total docker btrfs subvolumes found. syno_docker_cleanup.sh: line 97: syntax error near unexpected token `<' syno_docker_cleanup.sh: line 97: `readarray -t temp < <(btrfs subvolume list -p /"$volume"/@docker/btrfs/subvolumes)' ``` ``` -> % sudo ls -1 /volume1/@docker/btrfs/subvolumes | wc -l 130 -> % sudo du -hs /volume1/@docker/btrfs/subvolumes 33G /volume1/@docker/btrfs/subvolumes ``` I have subvolumes datting back to March of 2022, but most are much more current. It seems I'm overdue for a cleaning. I don't know what all you need to know though. Myh clone is as new as it gets. ``` -> % git log -1 commit cdb3154efa96faa0b542e1bc9c4ec4d5c155ceef (HEAD -> main, origin/main, origin/HEAD) Author: 007revad <39733752+007revad@users.noreply.github.com> Date: Thu Dec 18 21:14:51 2025 +1100 Update my-other-scripts.md ``` Thank you!
kerem closed this issue 2026-03-04 19:25:39 +03:00
Author
Owner

@007revad commented on GitHub (Dec 27, 2025):

% sudo sh syno_docker_cleanup.sh

The script is a bash script. Running it with sh will cause errors like the one you saw.

Try:

sudo -s syno_docker_cleanup.sh
<!-- gh-comment-id:3693558049 --> @007revad commented on GitHub (Dec 27, 2025): > % sudo sh syno_docker_cleanup.sh The script is a bash script. Running it with `sh` will cause errors like the one you saw. Try: ``` sudo -s syno_docker_cleanup.sh ```
Author
Owner

@mpalermo73 commented on GitHub (Dec 30, 2025):

% sudo sh syno_docker_cleanup.sh

The script is a bash script. Running it with sh will cause errors like the one you saw.

Try:

sudo -s syno_docker_cleanup.sh

Hey!

I endded up just +x'ing it and ran it. It says my system is as clean as it gets

-> % sudo ./syno_docker_cleanup.sh
Synology_docker_cleanup v1.2.4

132 total docker btrfs subvolumes found.
132 active docker btrfs subvolumes found.
0 orphan docker btrfs subvolume found.

No orphan subvolumes to delete.

No dangling images to delete.

Which... I don't know. I have some subvolumes sitting here from 2022. It seems I just need to better understand what the subvolumes actualy are and contain.

root@nas:/volume1/@docker/btrfs/subvolumes# ls -lt | tail
drwxr-xr-x 1 root root 168 Oct 20 20:11 7e93745b82ed457857e40912a15b4fd82120e14fa28a8596c0c2743e281b30bf
drwxr-xr-x 1 root root 132 Mar 16  2025 46f852f997e6ae3cd81e5dd80dc24e0b91da77fc92f8673c98cfe3f2560d4265
drwxr-xr-x 1 root root 114 Nov 27  2024 294bde054eef9a20ed58525e7135dd9316f4fd9abeac822c6a62db58a66fe04b
drwxr-xr-x 1 root root 114 Nov 27  2024 b047518a4ae66ee038975b12d168f3016c71c70743efca294d375746e23573ef
drwxr-xr-x 1 root root 228 Oct 26  2024 87dfa15d99c819c9554c4282bf51836811ff6ac57ac9b3e5b7792154635cfde8
drwxr-xr-x 1 root root 210 Oct 26  2024 2e56d579cdc54f252bf19a5ba592ed98133356db2f3de3ae6d0d3a6ca4833b08
drwxr-xr-x 1 root root 188 Mar 26  2022 87f78dd8a2514a97ea8b07c038d589505c36b3586e873de9d185f96a5c9606fb
drwxr-xr-x 1 root root 188 Mar 26  2022 8366eec883763f9e40c9d4dca66de00edea5cb0543d979ed4cf67384e1134996
drwxr-xr-x 1 root root 200 Mar 26  2022 50c7d26a92eb4e6389b5b27ae8a973e00a9cc2ef09b898a80f39767416cc87f4
drwxr-xr-x 1 root root 154 Mar 26  2022 83cd2976dde216fc7cacbb542402da597d0d8071b1bd6c903309d8b4c1f4ca4c
root@nas:/volume1/@docker/btrfs/subvolumes# ls -l | wc -l
133
root@nas:/volume1/@docker/btrfs/subvolumes# docker ps | wc -l
17

Thank you for replying!
M.

<!-- gh-comment-id:3700028347 --> @mpalermo73 commented on GitHub (Dec 30, 2025): > > % sudo sh syno_docker_cleanup.sh > > The script is a bash script. Running it with `sh` will cause errors like the one you saw. > > Try: > > ``` > sudo -s syno_docker_cleanup.sh > ``` Hey! I endded up just `+x`'ing it and ran it. It says my system is as clean as it gets ``` -> % sudo ./syno_docker_cleanup.sh Synology_docker_cleanup v1.2.4 132 total docker btrfs subvolumes found. 132 active docker btrfs subvolumes found. 0 orphan docker btrfs subvolume found. No orphan subvolumes to delete. No dangling images to delete. ``` Which... I don't know. I have some subvolumes sitting here from 2022. It seems I just need to better understand what the subvolumes actualy are and contain. ``` root@nas:/volume1/@docker/btrfs/subvolumes# ls -lt | tail drwxr-xr-x 1 root root 168 Oct 20 20:11 7e93745b82ed457857e40912a15b4fd82120e14fa28a8596c0c2743e281b30bf drwxr-xr-x 1 root root 132 Mar 16 2025 46f852f997e6ae3cd81e5dd80dc24e0b91da77fc92f8673c98cfe3f2560d4265 drwxr-xr-x 1 root root 114 Nov 27 2024 294bde054eef9a20ed58525e7135dd9316f4fd9abeac822c6a62db58a66fe04b drwxr-xr-x 1 root root 114 Nov 27 2024 b047518a4ae66ee038975b12d168f3016c71c70743efca294d375746e23573ef drwxr-xr-x 1 root root 228 Oct 26 2024 87dfa15d99c819c9554c4282bf51836811ff6ac57ac9b3e5b7792154635cfde8 drwxr-xr-x 1 root root 210 Oct 26 2024 2e56d579cdc54f252bf19a5ba592ed98133356db2f3de3ae6d0d3a6ca4833b08 drwxr-xr-x 1 root root 188 Mar 26 2022 87f78dd8a2514a97ea8b07c038d589505c36b3586e873de9d185f96a5c9606fb drwxr-xr-x 1 root root 188 Mar 26 2022 8366eec883763f9e40c9d4dca66de00edea5cb0543d979ed4cf67384e1134996 drwxr-xr-x 1 root root 200 Mar 26 2022 50c7d26a92eb4e6389b5b27ae8a973e00a9cc2ef09b898a80f39767416cc87f4 drwxr-xr-x 1 root root 154 Mar 26 2022 83cd2976dde216fc7cacbb542402da597d0d8071b1bd6c903309d8b4c1f4ca4c ``` ``` root@nas:/volume1/@docker/btrfs/subvolumes# ls -l | wc -l 133 root@nas:/volume1/@docker/btrfs/subvolumes# docker ps | wc -l 17 ``` Thank you for replying! M.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Synology_docker_cleanup#4
No description provided.