config: backup - search for tar in more bin dirs
This commit is contained in:
parent
3faeb82e88
commit
946edfd4ac
1 changed files with 11 additions and 0 deletions
11
src/config.c
11
src/config.c
|
@ -978,6 +978,17 @@ dobackup(const char *oldver)
|
|||
|
||||
getcwd(cwd, sizeof(cwd));
|
||||
|
||||
if (!access("/bin/tar", X_OK))
|
||||
argv[0] = "/bin/tar";
|
||||
else if (!access("/usr/bin/tar", X_OK))
|
||||
argv[0] = "/usr/bin/tar";
|
||||
else if (!access("/usr/local/bin/tar", X_OK))
|
||||
argv[0] = "/usr/local/bin/tar";
|
||||
else {
|
||||
tvherror("config", "unable to find tar program");
|
||||
goto fatal;
|
||||
}
|
||||
|
||||
snprintf(outfile, sizeof(outfile), "%s/backup", root);
|
||||
if (makedirs(outfile, 0700))
|
||||
goto fatal;
|
||||
|
|
Loading…
Add table
Reference in a new issue