LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-02-2009, 03:19 PM   #1
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Rep: Reputation: 31
I need comand for terminal to copy one directory


Hello. I have this comand for terminal

Code:
tar -zcvf /media/Multimedia/newexpbackup/01.backup.tar.gz /home/miros/Myboxfiles
By this comand I can copy one folder to another folder in difirent partitions or in the home network. I use it with gnome schedule program.
But when I use it network I must to add it user samba name and password and meybe the workgroup, but I dont know how to do it.
Can you tell me how can I add that to the comand above?
Must be comand for terminal and must be only one comand. I mean one line.
 
Old 09-02-2009, 03:37 PM   #2
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
Last I looked, tar didn't understand how to mount a file system.

So, just a shot in the dark, but...

I don't know the actual commands to do the mount for smb. But, if you mean that it has to be a single string of characters which a shell can interpret, could you do something like:
Code:
<samba mount command>;<tar command>;<samba unmount command>
If all gnome_schedule does is pass whatever you tell it to a shell, that should work.

Or, write a shell script with multiple lines and only call that script from the gnome_schedule program.

Last edited by nuwen52; 09-02-2009 at 03:43 PM.
 
Old 09-02-2009, 03:46 PM   #3
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
I dont need to mount or to unmount. I need to add user name and password for samba, because when you access to the homenetwork, you must enter user and password. So, I will cannot copy one directori to another in terminal if I dont enter user and password in this comand.
Any advice?
 
Old 09-02-2009, 03:54 PM   #4
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
Sorry, I don't do much with Windows shares. You mean, when you actually do the copy/tar/whatever, it asks you in a prompt for the login and password?

If yes, the only thing that comes to mind is an expect script. With expect, you can write a script to run the command, and it can respond to the prompts for you. Use something Like:
Code:
your_expect_script.exp <login> <password>
in your command line for gnome_schedule.

There are a lot of references on this board for how to write expect scripts.

As far as I have ever seen, tar cannot interact with the system enough to enter logins and passwords.

Last edited by nuwen52; 09-02-2009 at 03:58 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy files after search in array from this directory to another directory! phanvinhgiap Programming 4 01-04-2009 06:48 PM
how copy a file from a cd into the computer using the comand line? mariav Linux - Software 3 04-13-2007 10:07 PM
How do I copy from one directory to another in Terminal? beatupbilly Linux - Newbie 2 08-02-2006 01:58 AM
How to copy files from an entire directory tree using terminal commands??? lusius188 Linux - General 3 04-10-2006 11:23 AM
copy files from directory to directory without subfile ALInux Linux - General 2 06-03-2005 11:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration