![]() |
| | #1 |
| Registered User Join Date: Jan 2008
Posts: 35
| copy files to samba I 've a server that share a directory with samba. In my PC I see such directory in ubuntu i.e. smb://server/test. I need to create a script .sh to copy some files in smb://server/test So i perform cp smb://server/test *.txt but I get an error... My question is: How I can copy some files from my local PC to a server samba shared directory by shell commands? Thanks in advance Lollo |
| lollobrigido is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| Code: cp smb://server/test *.txt -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| Registered User Join Date: Jan 2008
Posts: 35
| Ok, exchanging the operands the result is the same! cp *.txt smb://server/test the command tel me that is impossible to create smb://server/test, but that directory already exists and dragging a file in such directory (graphically) it is ok! Lollo |
| lollobrigido is offline | |
| | #4 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| The smb:... directory does not really exist. Not the way the kernel sees it. You have to distinguish between two file systems here. One is the native Linux file system. It's rooted at / and all its absolute paths are of the form /something/or/other. The other is your desktop system's virtual file system. In order to transparently support more data sources without having to mount them into the kernel tree, all popular desktop environments (probably Gnome in your case) have a VFS that uses URLs are paths. They map the native kernel tree unto file://... URLs, and then go on and implement additional schemes, like smb://... (SMB or CIFS network file system), fish://... (KDE's ssh/scp-based remote file system), etc. These VFS URLs work only in programs written for this desktop environment and only if they really use only the DE's file manipulation routines. Shell utilities such as cp have no ideas what to do with these URLs. They only accept kernel file system paths. This means that if you want to use cp to copy files to a samba share, you have to mount it. Code: # mount -t cifs //server/test /mnt/test -o user=username
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with loading files into rich text box | blueparukia | C# Programming | 3 | 10-19-2007 12:59 AM |
| added start menu crashes game | avgprogamerjoe | Game Programming | 6 | 08-29-2007 01:30 PM |
| fopen vs. _open (for BIG image files) | reversaflex | C Programming | 3 | 04-01-2007 12:52 AM |
| Copy files | ErikDN | C Programming | 1 | 10-09-2004 07:50 PM |
| reinserting htm files into chm help files | verb | Windows Programming | 0 | 02-15-2002 09:35 AM |