Post

Remove tiddlywiki backup files from websupport

Use SFTP with regular expressions to bulk-remove TiddlyWiki backup files from a web hosting server.

This first example removes a single TiddlyWiki backup file via SFTP using a heredoc to automate the session.

1
2
3
4
sftp linuxinuse.com@linuxinuse.com << EOF
rm web/tw/index.20200430.153755.html
exit
EOF

Take advantage of regular expressions. Instead of deleting backup files one by one, use a glob pattern to match all timestamped backup files at once.

1
2
3
4
5
sftp linuxinuse.com@linuxinuse.com << EOF
rm  web/tw/index.[0-9\.]*.html
exit
EOF

This post is licensed under CC BY 4.0 by the author.