Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.