<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Thu Jun 20, 2013 4:32 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Thu Jun 20, 2013 4:32 am</pubDate>
  <lastBuildDate>Thu Jun 20, 2013 4:32 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90783#90783</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=3155'&gt;ajgreeny&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sat Jul 10, 2010 1:49 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Has the usb disk partition been given the label &amp;quot;hd&amp;quot; at some point in its history, as that would explain why it was mounting in a folder named /media/hd.&lt;br /&gt;
&lt;br /&gt;
If any usb disks I own are not already labeled appropriately by their manufacturer, I quickly give them a label I will know and recognise to make life that little bit easier for me.&lt;br /&gt;
&lt;br /&gt;
Odd about those two folders that will not copy, however.  Must be a permissions problem of some sort, I suspect.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90783#90783</comments>
                                        <author>ajgreeny</author>
                                        <pubDate>Sat Jul 10, 2010 1:49 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90783#90783</guid>
                                      </item>
                                      <item>
                                        <title>Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90768#90768</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5436'&gt;Dave-Pritchard&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Fri Jul 09, 2010 11:25 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi thanks for the reply&lt;br /&gt;
/media/ has 3 directories   cdrom, floppy, &amp;amp; hd&lt;br /&gt;
/media/hd  has the contents of the usb drive, so I changed  dir2 to&lt;br /&gt;
dir2 = &amp;quot;media/hd&amp;quot; and the script works OK&lt;br /&gt;
&lt;br /&gt;
( it could not copy 2 directories named Cuba and Tanzania, the usb drive will not accept directories with these names, or rename another to to them !!!&lt;br /&gt;
HOW WEEEERED  )&lt;br /&gt;
&lt;br /&gt;
Dave P..</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90768#90768</comments>
                                        <author>Dave-Pritchard</author>
                                        <pubDate>Fri Jul 09, 2010 11:25 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90768#90768</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90702#90702</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=130'&gt;Ram&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Jul 08, 2010 9:38 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      When the drive is mounted, what do you actually see listed in    /media/ ?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90702#90702</comments>
                                        <author>Ram</author>
                                        <pubDate>Thu Jul 08, 2010 9:38 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90702#90702</guid>
                                      </item>
                                      <item>
                                        <title>Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90700#90700</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5436'&gt;Dave-Pritchard&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Jul 08, 2010 8:13 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi  thanks for the reply&lt;br /&gt;
&lt;br /&gt;
here is the result from the suggested command&lt;br /&gt;
&lt;br /&gt;
[dave@localhost ~]$  ls -ld /media/sdf1&lt;br /&gt;
ls: cannot access /media/sdf1: No such file or directory&lt;br /&gt;
[dave@localhost ~]$&lt;br /&gt;
&lt;br /&gt;
clicking on the &amp;quot;storage media&amp;quot; icon, brings up konqueror with an icon for the usb drive, I am able to copy to and from the drive, brining up the permissions/mounting indicates - mountpoint /media/hd , also mount automaticaly is ticked.&lt;br /&gt;
looking at /media/hd  just displays the /home/dave desktop icons !&lt;br /&gt;
&lt;br /&gt;
I tried running the script while konqueror was open and accessing the drive, but with the same result.&lt;br /&gt;
&lt;br /&gt;
Dave P..</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90700#90700</comments>
                                        <author>Dave-Pritchard</author>
                                        <pubDate>Thu Jul 08, 2010 8:13 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90700#90700</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90669#90669</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Jul 07, 2010 2:31 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      What does&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&amp;nbsp;ls -ld /media/sdf1&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
show. Is the drive mounted when you run this script?</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90669#90669</comments>
                                        <author>nelz</author>
                                        <pubDate>Wed Jul 07, 2010 2:31 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90669#90669</guid>
                                      </item>
                                      <item>
                                        <title>Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90665#90665</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5436'&gt;Dave-Pritchard&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Jul 07, 2010 9:25 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi &lt;br /&gt;
Thanks for the reply, previous errors cleared, but I am getting a permission denied error, not sure if this is the correct place to post this type of problem.&lt;br /&gt;
/media/sdf1/ is a usb hard drive, permissions owner = dave group = dave&lt;br /&gt;
device node = /dev/sde1  &amp;amp; base url = &lt;a href=&quot;file:///media/hd&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;file:///media/hd&lt;/a&gt;&lt;br /&gt;
still stuck, so any help most welcome&lt;br /&gt;
Dave P..&lt;br /&gt;
&lt;br /&gt;
script and error message follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
clear&lt;br /&gt;
echo &amp;quot;STARTING BACK-UP OF /HOME/DAVE/&amp;quot;&lt;br /&gt;
dir1=&amp;quot;/home/dave/&amp;quot;&lt;br /&gt;
dir2=&amp;quot;/media/sdf1/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ -d $dir1 -a -d $dir2 ]&lt;br /&gt;
then&lt;br /&gt;
  sync --recursive --times --perms --exclude &amp;quot;~*&amp;quot; --exclude &amp;quot;*bak&amp;quot; $dir1 $dir2&lt;br /&gt;
  echo &amp;quot;BACK-UP COMPLETE&amp;quot;&lt;br /&gt;
elif [ -d $dir1 ]&lt;br /&gt;
  mkdir $dir2 &lt;br /&gt;
  rsync --recursive --times --perms --exclude &amp;quot;~*&amp;quot; --exclude &amp;quot;*bak&amp;quot; $dir1 $dir2&lt;br /&gt;
  echo &amp;quot;BACK-UP COMPLETE&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;UNABLE TO LOCATE SOURCE DIRECTORY&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
Error message follows&lt;br /&gt;
&lt;br /&gt;
STARTING BACK-UP OF /HOME/DAVE/&lt;br /&gt;
mkdir: cannot create directory `/media/sdf1/': Permission denied&lt;br /&gt;
rsync: mkdir &amp;quot;/media/sdf1&amp;quot; failed: Permission denied (13)&lt;br /&gt;
rsync error: error in file IO (code 11) at main.c(529) [receiver=2.6.9]&lt;br /&gt;
rsync: connection unexpectedly closed (8 bytes received so far) [sender]&lt;br /&gt;
rsync error: error in rsync protocol data stream (code 12) at io.c(453) [sender=2.6.9]&lt;br /&gt;
BACK-UP COMPLETE&lt;br /&gt;
[dave@localhost ~]$</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90665#90665</comments>
                                        <author>Dave-Pritchard</author>
                                        <pubDate>Wed Jul 07, 2010 9:25 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90665#90665</guid>
                                      </item>
                                      <item>
                                        <title>Re: Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90656#90656</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=2793'&gt;MartyBartfast&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Jul 06, 2010 10:39 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Well &lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
dir2=&amp;quot;/media&amp;#58;/sdf1&amp;quot;&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
has a superfluous colon &lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;&lt;br /&gt;
if&amp;#91; -d $dir1 -a -d $dir2 &amp;#93; &lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
needs a space between if and [ &lt;br /&gt;
&lt;br /&gt;
edit to add, same problem with elif[&lt;br /&gt;
HTH</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90656#90656</comments>
                                        <author>MartyBartfast</author>
                                        <pubDate>Tue Jul 06, 2010 10:39 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90656#90656</guid>
                                      </item>
                                      <item>
                                        <title>Script Problem</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=90654#90654</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5436'&gt;Dave-Pritchard&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Jul 06, 2010 10:31 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi&lt;br /&gt;
&lt;br /&gt;
My first attempt at writing/using a script, basicly taken from&lt;br /&gt;
LXF 126  PAGE 48 TO 51 to do a backup. &lt;br /&gt;
The computer is not always on, so I need to backup when needed&lt;br /&gt;
hopefully from an icon if possible, however the script does not work. any help most welcome. Script and error message follows.&lt;br /&gt;
Dave P..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
clear&lt;br /&gt;
echo &amp;quot;STARTING BACK-UP OF /HOME/DAVE/&amp;quot;&lt;br /&gt;
dir1=&amp;quot;/home/dave/&amp;quot;&lt;br /&gt;
dir2=&amp;quot;/media:/sdf1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if[ -d $dir1 -a -d $dir2 ]&lt;br /&gt;
then&lt;br /&gt;
rsync --recursive --times --perms --exclude &amp;quot;~*&amp;quot; --exclude &amp;quot;*bak&amp;quot; $dir1 $dir2&lt;br /&gt;
 echo &amp;quot;BACK-UP COMPLETE&amp;quot;&lt;br /&gt;
elif[ -d $dir1 ]&lt;br /&gt;
then&lt;br /&gt;
  mkdir $dir2 &lt;br /&gt;
  rsync --recursive --times --perms --exclude &amp;quot;~*&amp;quot; --exclude &amp;quot;*bak&amp;quot; $dir1 $dir2&lt;br /&gt;
  echo &amp;quot;BACK-UP COMPLETE&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;UNABLE TO LOCATE SOURCE DIRECTORY&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
Running the script produces the following&lt;br /&gt;
&lt;br /&gt;
STARTING BACK-UP OF /HOME/DAVE/&lt;br /&gt;
backup.sh: line 8: if[ -d /home/dave -a -d /media:/sdf1 ]: No such file or directory&lt;br /&gt;
backup.sh: line 9: syntax error near unexpected token `then'&lt;br /&gt;
backup.sh: line 9: `then'&lt;br /&gt;
[dave@localhost ~]$</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=90654#90654</comments>
                                        <author>Dave-Pritchard</author>
                                        <pubDate>Tue Jul 06, 2010 10:31 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=90654#90654</guid>
                                      </item></channel></rss>