Skip to content
Snippets Groups Projects
Commit 8e306868 authored by nimrod's avatar nimrod
Browse files

Don't complain on missing files.

Removing existing backups is needed if they exist. But the output is
littered with rm complaining about non-existing files. Instead, check if
the file exists, then remove it.
parent e1f526e7
No related branches found
No related tags found
No related merge requests found
Pipeline #2454 failed
......@@ -36,7 +36,7 @@ NR>2 {
image_url = registry "/" $1 ":" $(i)
image_file = dest "/" $1 "/" $(i) ".tar"
printf "Saving %s to %s.\n", image_url, image_file
system("rm " image_file)
system("[ -f " image_file " ] || rm " image_file)
if (system("skopeo copy docker://" image_url " docker-archive://" image_file) == 0)
printf "Backup of %s was successful.\n", image_url
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment