1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

wput command for upload no file or directory

Discussion in 'Site & Server Administration' started by xbat, Dec 3, 2013.

  1. #1
    anyone know how to use wput? I am using centos 6.4 and everytime I run this file I keep getting no such file or directory..

    wput--/var/www/html/sma_load/folder_folder/somefile.txt ftp://ftpuser:ftppassword@ftp.mysite.com
     
    Solved! View solution.
    xbat, Dec 3, 2013 IP
  2. dayvo

    dayvo Active Member

    Messages:
    585
    Likes Received:
    52
    Best Answers:
    1
    Trophy Points:
    55
    #2
    Have you tried adding a directory on to the end of the ftp server.. For example:

    wput /var/www/html/sma_load/folder_folder/somefile.txt ftp://ftpuser:ftppassword@ftp.mysite.com/somefolder/

    Be careful with wput if your on shared server as a ps -aux will show your command in all its glory, including password
     
    dayvo, Dec 3, 2013 IP
  3. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #3

    I get the same error. but I am using wput--/var/etc............ not wput /var/etc... If I do not use the dashes then I will get the help page showing up.
     
    xbat, Dec 3, 2013 IP
  4. dayvo

    dayvo Active Member

    Messages:
    585
    Likes Received:
    52
    Best Answers:
    1
    Trophy Points:
    55
    #4
    What's the error your getting?
     
    dayvo, Dec 3, 2013 IP
  5. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #5
    no such file or directory exists

    the only other thing I could think of is.. maybe I need to start my /var off with F:/var
     
    xbat, Dec 3, 2013 IP
  6. dayvo

    dayvo Active Member

    Messages:
    585
    Likes Received:
    52
    Best Answers:
    1
    Trophy Points:
    55
    #6
    ok - Im assuming it does exist - have you tried cd'ing to the directory and doing wput filename ftp@server (so just the filename on its own with no path) Also - add an / on the end of the ftp server, just in case

    Also - the user you are logged in as has permission to the file?
     
    dayvo, Dec 3, 2013 IP
  7. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #7
    I tried changing directorys right up till where I was in the same driectory as somefile.txt and still got the same error. So even with no path I still got the same issue. As for permissions I am logged in ssh as root. As for uploading the file to the server I tried with filezilla and no issues. So I'm guessing I must be typing something incorrectly with wput maybe..
     
    xbat, Dec 3, 2013 IP
  8. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #8
    I get >> bash:wput--/var/www/html/sma_load/folder_folder/somefile.txt: No such file or directory

    if I do just somefile.txt without the directory after I have changed directorys then I get the same thing..

    I'm thinking wput--/directory/etc... isn't correct thats my best idea...
     
    Last edited: Dec 3, 2013
    xbat, Dec 3, 2013 IP
  9. dayvo

    dayvo Active Member

    Messages:
    585
    Likes Received:
    52
    Best Answers:
    1
    Trophy Points:
    55
    #9
    hmmmmmmm, clutching at straws here.. but I wonder if its waiting for an option as your using --

    Have you tried this:

    wput --input-file=/var/www/html/sma_load/folder_folder/somefile.txt ftp://ftpuser:ftppassword@ftp.mysite.com/
     
    dayvo, Dec 3, 2013 IP
  10. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #10
    I just tried that and same issue.. I tried it with both wput--input etc.. and wput --input etc


    Is there some way to upload a file by command that works better? I am all ears
     
    xbat, Dec 3, 2013 IP
  11. #11
    Do you have ssh access on the ftp server?

    I much prefer to use rsync, although I usually use that for folders but I would have thought it could be used for individual files too. I think you could also use scp - but i think you still need ssh access

    Once im back to my normal computer I will try wput on one of my servers, in case rsync isnt suitable
     
    dayvo, Dec 3, 2013 IP
  12. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #12
    no I dont have any access to port 22 at all.. I was going to use ftp php upload but they seem to have that blocked too
     
    xbat, Dec 3, 2013 IP
  13. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #13
    I got it to work with ftp php and passive through a cron job. Long as that works I am happy for now. I will pretty it up later. Thanks for all your support.
     
    xbat, Dec 4, 2013 IP