Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Command line help. Move/copy a file to a shared windows folder?

  1. #1
    Join Date
    Dec 2009
    Beans
    26

    Cool Command line help. Move/copy a file to a shared windows folder?

    I am able to view my windows network from my UBUNTU desktop after being prompted for a username and password to the windows network. No problem. But how can I accomplish this from the command prompt?

    Here is my windows directory;
    smb://corpserver/d$/Data

    And here is what I am trying to accomplish;
    Code:
    mv /var/lib/mysql/RSecuredData.csv smb://corpserver/d$/Data/Common/Secured%20R%20Reports/$(date +%Y%m%d)_RSecuredData.csv
    Basically taking a csv file and moving it from mysql directory on my Ubuntu machine to a network folder on my windows server. (Windows Server 2003)

    When I try that command from the command prompt I recieve;
    Code:
    mv: cannot move `/var/lib/mysql/RepoSecuredData.csv' to `smb://corpserver/d$/Data/Common/Secured%20Repo%20Reports/20100323_RepoSecuredData.csv': No such file or directory
    Please help.
    Regards,
    Shawn

  2. #2
    Join Date
    Dec 2009
    Beans
    540
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Command line help. Move/copy a file to a shared windows folder?

    Once you have mounted the share, you can navigate to it in the ~/.gvfs directory. This makes it an easy
    Code:
    mv /path/to/file ~/.gvfs/shared/directory/name/filename

  3. #3
    Join Date
    Dec 2009
    Beans
    26

    Re: Command line help. Move/copy a file to a shared windows folder?

    Thanks. I have the driver shared and mounted as corpserver/$d

    When I try using this command
    Code:
    mv /var/lib/mysql/RSecuredData.csv ~/.gvfs/corpserver/$\d/RSecuredData.csv
    I receive this error;

    Code:
    mv: cannot move `/var/lib/mysql/RSecuredData.csv' to `/home/ftpaccount/.gvfs/corpserver/$d/RSecuredData.csv': No such file or directory
    Any suggestions? Thank you!

  4. #4
    Join Date
    Dec 2009
    Beans
    540
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Command line help. Move/copy a file to a shared windows folder?

    Can you 'see' the share in terminal?

    Code:
    cd ~/.gvfs && ls

  5. #5
    Join Date
    Dec 2009
    Beans
    26

    Re: Command line help. Move/copy a file to a shared windows folder?

    Yes, I can see both of my shares listed;

    Code:
    ftpaccount@administrator-ubuntu:~$ cd ~/.gvfs && ls
    d$ on corpserver  profiles$ on corpserver
    ftpaccount@administrator-ubuntu:~/.gvfs$

  6. #6
    -grubby is offline May the Ubuntu Be With You!
    Join Date
    Aug 2007
    Beans
    Hidden!

    Re: Command line help. Move/copy a file to a shared windows folder?

    ls accepts directory arguments, no need to cd . Also, mv doesn't accept protocol arguments like Nautilus does (smb://)

  7. #7
    Join Date
    Dec 2009
    Beans
    540
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Command line help. Move/copy a file to a shared windows folder?

    d$ on corpserver profiles$ on corpserver
    /home/ftpaccount/.gvfs/corpserver/$d/RSecuredData.csv
    Don't put corpserver in the line. it should be /home/ftpaccount/.gvfs/$d/RSecuredData.csv

  8. #8
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Command line help. Move/copy a file to a shared windows folder?

    I've always found content in .gvfs to be locked down to the extent that you can't really do anything with it from the cli. every time i try to get it to work, I get
    "file not found"
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  9. #9
    Join Date
    Dec 2009
    Beans
    26

    Re: Command line help. Move/copy a file to a shared windows folder?

    Thanks. I just tried that but same result :\

    Code:
    ftpaccount@administrator-ubuntu:/$ mv /var/lib/mysql/RSecuredData.csv ~/.gvfs/$\d/RSecuredData.csv
    mv: cannot move `/var/lib/mysql/RSecuredData.csv' to `/home/ftpaccount/.gvfs/$d/RSecuredData.csv': No such file or directory
    I have been using $\d for $d so I the console wouldn't think the $ as a function

  10. #10
    Join Date
    Dec 2009
    Beans
    540
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Command line help. Move/copy a file to a shared windows folder?

    I've always found content in .gvfs to be locked down to the extent that you can't really do anything with it from the cli. every time i try to get it to work, I get
    "file not found"
    I've used it often, with no troubles. I even use it to virus scan with clam over the network.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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