Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    Is that the actual script you are using? There's a syntax error in the for statement. There ought to be a ; (or a newline) before do. Also, you are much better off iterating over /home/*/, as in for serverpath in /home/*/; do server=$(basename "$serverpath"); tar ... "$serverpath"; done or something like that. Commented Apr 7, 2019 at 21:43
  • You may also have problems with your ls ../home results if the files listed have whitespace in their names, or newline characters etc.. consider feeding your for loop (or a while loop) a list of null separated results instead. Commented Apr 8, 2019 at 0:19
  • The do in my code was one line below, I have edit as my code is ^^ Ok for the /home/*/ and yes you right @JeffH.I have a space after the server name ! Commented Apr 8, 2019 at 8:09
  • I think home should be /home. Commented Apr 13, 2019 at 18:27
  • Any particular reason why tar's output file has a *.zip extension? I ask because *.zip files are not the same as bzip files. Commented Apr 13, 2019 at 22:39