Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I'm a newbie to Linux and I'm trying to automate FTP'ing some files from my NAS box. I have a QNAP TS-509 box and I have some 20+ Gigs ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    8

    How can I FTP files in a background process?

    Hi,

    I'm a newbie to Linux and I'm trying to automate FTP'ing some files from my NAS box.

    I have a QNAP TS-509 box and I have some 20+ Gigs I want to FTP, but as a background process running on my NAS.

    From my laptop, if I telnet into my NAS and use ftp from the command line and if I keep the telnet session running, everything works great. I also did this successfully using a python script.

    But I don't want to have to keep my laptop running a telnet session because, for example, just before I travel, I would like to start the ftp transfer running on my NAS, then shutdown my laptop because I have to travel. So, as I am traveling, the ftp process is still running on my NAS.

    I've tried creating a background process as follows:
    1. From my laptop, Telnet into my NAS
    2. Start FTP transfer
    3. Press Control-Z
    4. At the shell prompt, enter the command "bg"
    5. Exit/close the Telnet window


    After I exit, I certainly do see internet traffic/activity on my NAS, confirming the process is still running. But by overnight, there's no more activity and the FTP is incomplete (ranging from none or just one or two files). Again, if I do the above in all foreground, the all files get transferred, no issues.

    Is there something wrong with the way I am launching the background process? Should I be doing it another way?

    Thanks!

  2. #2
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    845
    You can just use nohup: nohup MAN Page

    To use it simply put nohup before your ftp command:

    Code:
    nohup ftp...
    Linux User #453176

  3. #3
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    845
    Note you should only use this where there is one line to be executed as nohup will launch the process into the background and so you wont be able to interact with it
    Linux User #453176

  4. #4
    Just Joined!
    Join Date
    Aug 2009
    Posts
    8
    Thanks for the tip, but nohup isn't there for me. On my NAS, it is Ubuntu 4.1.2-16.

    But I just got reference to try GNU Screen or VNC...I'm going to look into those.

  5. #5
    Just Joined!
    Join Date
    Aug 2009
    Posts
    8
    I got nohup, tried it, but I also tried screen and that was better. So now I'm using screen.

  6. #6
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    845
    Excellent! Thanks for letting us know your solution
    Linux User #453176

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...