Skip to content

Commit

Permalink
main.c: backup: tgz: change backup script don't use awk
Browse files Browse the repository at this point in the history
  • Loading branch information
yuk7 committed Jan 31, 2020
1 parent 776f2af commit add40c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ int main()

hr = WslLaunchInteractive(TargetName,
L"LANG=C \n"
L"bakarg_drv=$(mount --show-labels|awk '{if(!match($3,/(^\\/$)|(^\\/dev)|(^\\/sys)|(^\\/proc)|(^\\/run)/)){print \"--exclude \\\"\" substr($3, 2) \"\\\"\"} }') \n"
L"bakarg_sys=\"--exclude \\\"dev/*\\\" --exclude \\\"sys/*\\\" --exclude \\\"proc/*\\\" --exclude \\\"run/*\\\" \" \n"
L"bakarg_drv=$(mount --show-labels|cut -d ' ' -f3|cut -c 2-|grep -v -e '^\\s*$' -e '^\\s*dev' -e '^\\s*sys' -e '^\\s*proc' -e '^\\s*run'|sed 's/^/--exclude=\\\"/g'|sed 's/$/\\\"/'|tr '\\n' ' ') \n"
L"bakarg_sys=\"--exclude=\\\"dev/*\\\" --exclude=\\\"sys/*\\\" --exclude=\\\"proc/*\\\" --exclude=\\\"run/*\\\" \" \n"
L"su root -c \"tar -zcpf backup.tar.gz ${bakarg_sys} ${bakarg_drv} /\" \n"
, true, &exitCode);

Expand Down

0 comments on commit add40c2

Please sign in to comment.