Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


any convenient way to run long-time script on server without my PC stays on?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

any convenient way to run long-time script on server without my PC stays on?

qtwrkqtwrk Member
edited September 2017 in Help

Hi guys , I got a little inconvenient problem,
let's say , for example I have to do a rsync with few hundreds GB , which takes hours and hours to finished , and during that time I have to keep SSH terminal open, but sometimes during the rsync , something will knock me offline , take PC reboot , pack and take it out so whatever the case is, which will effectively terminated rsync operation.

and the VPS provider doesn't provide VNC , my current way out of this is using VPS2 with VNC , and SSH from VPS2 into VPS1 and doing rsync there, but this is most inconvenient, as VPS2 only comes with web-based VNC which is NOT operable in mobile browser.

so there is any way , I can keep command or script running on VPS , while I can safely offline ?

perhaps cron , but I don't know why same command on SSH is working fine and on cron will just failed miserably ,

do I have any other options ?

Comments

  • tmux, screen, or just nohup

  • GuyPGuyP Member
    edited September 2017

    Screen will work. Launch screen, run your command. Ctrl+a-d to detach, logout of ssh. When you ssh back in, screen -r to resume.

  • byobu command is a friendly frontend to screen /tmux, included in Ubuntu /debian repos

  • @Aidan said:
    Run it in screen

    https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/

    https://www.howtoforge.com/linux_screen
    @seanho said:
    tmux, screen, or just nohup
    @GuyP said:
    Screen will work. Launch screen, run your command. Ctrl+a-d to detach, logout of ssh. When you ssh back in, screen -r to resume.

    okay ,screen looks promising , but next question is , if I use mobile device , how can I "ctrl + a + d" ? I mean , I can do ctrl +a and/or ctrl +d , but I think I can't make it happen ctrl +a +d ...

    @vimalware said:
    byobu command is a friendly frontend to screen /tmux, included in Ubuntu /debian repos

    thanks , but I will try screen first.

  • GuyPGuyP Member
    edited September 2017

    qtwrk said: if I use mobile device , how can I "ctrl + a + d" ?

    When I ssh to a server and open screen let's say in Putty or xterm, if I close (not logout) the ssh session (or the ssh session is disconnected), the screen usually detaches on its own. So no need to detach with ctrl+a-d. Usually when I ssh back in, I can just type screen -r to resume despite not "cleanly" detaching.

  • never mind , I figured out.

    thank you guys , much appreciated.

  • qtwrk said: I use mobile device , how can I "ctrl + a + d" ?

    On Android, use JuiceSSH, they have nice buttons for ctl, esc, arrows, etc. Best way to do terminal work on a mobile.

  • @NodePing said:
    On Android, use JuiceSSH, they have nice buttons for ctl, esc, arrows, etc. Best way to do terminal work on a mobile.

    ...or a portable Bluetooth keyboard?

  • @NodePing said:

    qtwrk said: I use mobile device , how can I "ctrl + a + d" ?

    On Android, use JuiceSSH, they have nice buttons for ctl, esc, arrows, etc. Best way to do terminal work on a mobile.

    As matter of fact that's what I am using , the thing is not CTRL, it's about how do you input 3 key simultaneously.

  • @WSS said:

    @NodePing said:
    On Android, use JuiceSSH, they have nice buttons for ctl, esc, arrows, etc. Best way to do terminal work on a mobile.

    ...or a portable Bluetooth keyboard?

    In that case, I'd say it's even more inconvenient...

  • OK. An IBM Model M, a USB->PS/2 adapter, an AT->PS/2 adapter, and an OTG adapter.

  • Oh, and a phone.

  • @qtwrk said:

    @NodePing said:

    qtwrk said: I use mobile device , how can I "ctrl + a + d" ?

    On Android, use JuiceSSH, they have nice buttons for ctl, esc, arrows, etc. Best way to do terminal work on a mobile.

    As matter of fact that's what I am using , the thing is not CTRL, it's about how do you input 3 key simultaneously.

    The control button will stay pressed just press 1 by 1 and it will detached i use it daily

Sign In or Register to comment.