Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-21-2004, 09:02 AM
|
#1
|
|
LQ Newbie
Registered: Jun 2004
Posts: 27
Rep:
|
backup from directory with spaces
I have written a backup script to allow for backups from across a windows network and am having trouble with backing up directories that have spaces as their name i.e backup test. It works if the share name is backup_test. I know that linux doesn't like spaces and can use \ to specify a space but that is not working. Does anyone have any suggestions?
Cheers,
Dennis
|
|
|
|
06-21-2004, 09:06 AM
|
#2
|
|
Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131
Rep: 
|
try to enclose the filename/whole path inside "" -marks, like
"backup test"
instead of
backup test OR backup\ test
dunno if it helps...but it's often quicker at least in bash usage than \ -marks
|
|
|
|
06-21-2004, 09:18 AM
|
#3
|
|
LQ Newbie
Registered: Jun 2004
Posts: 27
Original Poster
Rep:
|
This doesn't seem to be working. Would I have to put:
BACKUP_SHARE="backup test"
or
"BACKUP_SHARE=backup test"
I tried the first one and that doesn't work for me. Any other ideas other than having everyone change the directories? Some of this directories are shares that involve microsoft paths i.e c:\program files ... etc
Cheers,
Dennis
|
|
|
|
06-21-2004, 10:30 AM
|
#4
|
|
LQ Newbie
Registered: Jun 2004
Posts: 27
Original Poster
Rep:
|
Anyone have a suggestion??
|
|
|
|
06-21-2004, 12:36 PM
|
#5
|
|
LQ Newbie
Registered: Jun 2004
Posts: 27
Original Poster
Rep:
|
here is a copy of the script:
#!/bin/bash
#this is the administrator account on the windows machines
USERNAME1=administrator
PASSWORD1=administrator_password
#
DRIVE=/root/backup
#
TARGET_MACHINE=laptop
BACKUP_SHARE=backup test ***this is where the trouble lies***
#
mkdir $DRIVE/$TARGET_MACHINE
cd $DRIVE/$TARGET_MACHINE
#
smbclient //$TARGET_MACHINE/$BACKUP_SHARE $PASSWORD1 -U $USERNAME1 -c "recurse;prompt;mget *;"
#
tar cvpz $DRIVE/$TARGET_MACHINE > $DRIVE/$TARGET_MACHINE.tar.gz
rm -rf $DRIVE/$TARGET_MACHINE
#
Cheers,
Dennis
|
|
|
|
06-21-2004, 12:45 PM
|
#6
|
|
Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131
Rep: 
|
Quote:
This doesn't seem to be working. Would I have to put:
BACKUP_SHARE="backup test"
or
"BACKUP_SHARE=backup test"
|
it was the upper one of those I thought...but if it won't work, then I have no clue :/ sorry..I don't do this kind of scripting that much myself..but I think someone has asked a thing like this earlier...I'm not sure if it was just like this, but had something to do with spaces in scripting...damn, if only I could remember what thread it was..
|
|
|
|
06-21-2004, 12:49 PM
|
#7
|
|
LQ Newbie
Registered: Jun 2004
Posts: 27
Original Poster
Rep:
|
Thanks anyway, I will look around.
Cheers,
Dennis
|
|
|
|
06-21-2004, 10:14 PM
|
#8
|
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
Did you try:
BACKUP_SHARE="backup\ test"
with the space after the backslash?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:04 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|