printinghilt.blogg.se

Tar compress and ssh to remote folder
Tar compress and ssh to remote folder












tar compress and ssh to remote folder

To do this, of course, you need to know how the Backissues folder is structured. It is also better practice: when you have a new back issue you will not need to redo the whole archive, and when you need access to a back issue, you only have to unzip the one you need. This breaks the work into distinct parts that can be executed separately and would fail separately.

Tar compress and ssh to remote folder zip file#

An improvement would be that instead of making one zip file of everything, you make one zip file for every back issue (assuming that your goal is to reduce space, and not to simply get a single file). You can in any case use the zip command's functionality to split output files into pieces, but I suppose you have many back issues. Otherwise you have to rely on an error showing up in nohup.out, or zip only renaming the output file to its intended name when the process completes successfully. Will leave you a tell-tale file that guarantees that the long-running zip operation finished correctly.

tar compress and ssh to remote folder

Using this command instead: nohup bash -c "zip -r backissue.zip Backissues/ & touch backissue.finished" & You do have to do that, remembering that the job may still be running in the background, because if you restart a process when another one is still executing you may run into needless problems. As long as your connection stays open, you can use the jobs bash command to manage the background zip command, but once you log off or your ssh connection breaks and you have to reconnect, you will have to check your process using ps or top, and the output in the file nohup.out that the nohup command creates. This does two things: the trailing & makes the zip process execute in the background, and the nohup disconnects the zip process from the connection you are using so that your ssh disconnecting will not interrupt the execution of the zip process. Instead of executing zip -r backissue.zip Backissues/, you execute nohup zip -r backissue.zip Backissues/ & Your main problem, the timeouts, is fixed by using background and nohup. This is not really an ssh question the reason ssh is an issue here is because you have timeouts due to the action taking so much time.














Tar compress and ssh to remote folder