Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Examples

Guillem Jara edited this page Oct 4, 2021 · 2 revisions

Now that we've seen how Voila works, let's see some real-world examples:

  • voila /backup "@creation=date <= 2020-01-01 { print(@name has been deleted) delete(@path) }: Voila will delete every file in /backup whose creation was earlier to 2020 printing a delete message.
  • voila /backup "@name ~= (.*)-2020 { print(@name has been deleted) delete(@path) }: Voila will delete every file in /backup ending in 2020 printing a delete message.
  • voila /something "@sum=md5 == 308uyrp028y4hp079y2hv92gbf49 { mkdir(./sums); create(./sums/@name.sum, @sum=sha256) }: Voila will create a folder in the current directory named "sums", will search for a file with a specific md5 checksum, get its sha256 checksum and save it in the sums folder.
  • voila /backup "@size=gb >= 1 { print(@name has been deleted) delete(@path) }: Voila will delete every file in /backup heavier than 1gb, printing a delete message.
Clone this wiki locally