2015-09-05 16:01:43 +02:00
|
|
|
// names may be a series of files in src, not a wildcard.
|
|
|
|
// if it's empty then all files in src are used.
|
|
|
|
// the files are gzipped and logged in dest.
|
|
|
|
// src and dest do not have to end in /
|
|
|
|
|
|
|
|
void logZip(string src, string names, string dest)
|
|
|
|
{
|
|
|
|
list files;
|
|
|
|
int idx;
|
|
|
|
string file;
|
|
|
|
|
|
|
|
chdir(g_cwd);
|
|
|
|
|
|
|
|
dest += "/";
|
|
|
|
|
|
|
|
md(dest);
|
|
|
|
|
|
|
|
if (src != "")
|
|
|
|
chdir(src);
|
|
|
|
|
|
|
|
if (names == "")
|
|
|
|
files = makelist("*");
|
|
|
|
else
|
|
|
|
files = strtok(names, " ");
|
|
|
|
|
2015-12-08 20:26:10 +01:00
|
|
|
for (idx = listlen(files); idx--; )
|
2015-09-05 16:01:43 +02:00
|
|
|
{
|
|
|
|
file = files[idx];
|
|
|
|
run("gzip -n -9 < " + file + " > " + g_cwd + dest + file + ".gz");
|
|
|
|
}
|
|
|
|
|
|
|
|
chdir(g_cwd + dest);
|
2015-12-08 20:26:10 +01:00
|
|
|
for (idx = listlen(files); idx--; )
|
2015-09-05 16:01:43 +02:00
|
|
|
log(files[idx] + ".gz");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|