Find the answer to your Linux question:
Results 1 to 5 of 5
hi all, Im a complete noob to the world of linux but have been learning as I go along trying to setup a script on my thecus NAS to backup ...
  1. #1
    Just Joined!
    Join Date
    May 2011
    Posts
    4

    [SOLVED] n00b learning on the fly - trying to script on Thecus

    hi all, Im a complete noob to the world of linux but have been learning as I go along trying to setup a script on my thecus NAS to backup to an external eSATA drive. Ive got SSH access using Putty and have bodged up a script from much research and reading other peoples solutions on the net - however when I ran the rsync script it ran very slowly, and after 4 or 5 hours I had to shut my laptop down to go home, which interrupted the script and seems to have left a file/directory (?) behind which I now cant get rid of.
    im attaching a screendump of what Im talking about - basically the rsync script is supposed to backup to the eSATAHDD folder, which the external drive is mounted to - but after 5 hours of thrashing, nothing is on the external disk and theres another file/folder (?) called eSATAHDD without a trailing slash (but a slash in the file permissions which Ive been unable to find the meaning of despite relentless googling)
    so firstly i want to figure out how to remove that file/directory/whatever, then perhaps get some help in getting my backup to work.
    thanks in advance!
    Attached Images Attached Images

  2. #2
    Linux User
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    262
    Your second "eSATAHDD" includes at least one control character as it did a carriage return (CR) which put the trailing slash ("/") at the start of the line. Since it is part of the name it needs to be included when doing the "rmdir" command.

    To include the carriage return the before hitting the "Enter" key on the command:
    Code:
    rmdir eSATAHDD
    type a "Control-v" and a "control-m"

    The "Control-v" says use the next key press as the character for the two (really special quoting) and the "Control-m" is the "carriage return" key press.

    Somethings to watch out for and avoid:
    1) including "/dev", "/proc", or "/sys" in the backed up data
    2) including a directory that is the mount point that you arewritting your backup.
    3) including a directory thateSATAHDD is a large partition mounted that

  3. #3
    Just Joined!
    Join Date
    May 2011
    Posts
    4
    thanks for the quick reply, really appreciated!
    it makes sense what you said, however the CTRL+V keypress doesnt seem to have any effect, as soon as I hit CTRL+M, the command is entered and I get the error message 'no such directory'
    is there a problem with ctrl+V with PuTTY maybe?

  4. #4
    Just Joined!
    Join Date
    May 2011
    Posts
    4
    ok im getting somewhere, I managed to get rid of it as follows:

    rm -r eSATAHDD*

    now I just need to figure out why it happened and make it work properly next time! here is the script im using if anyone can help?

    #!/bin/sh
    now=`date +"%Y-%m-%d"`
    logfile="backup-$now.log"
    touch /raid/"joes stuff"/backuplog/$logfile
    rsync -raz --delete --stats --progress /raid/Backup /raid/eSATAHDD
    echo "Backup Folder Result" > /raid/"joes stuff"/backuplog/$logfile
    diff --brief /raid/Backup /raid/eSATAHDD/backup >/raid/"joes stuff"/backuplog/$logfile
    echo "" >/raid/"joes stuff"/backuplog/$logfile
    echo "Backup Completed" > /raid/"joes stuff"/backuplog/$logfile

  5. #5
    Just Joined!
    Join Date
    May 2011
    Posts
    4
    thanks again alf, I figured out my main problem was editing the scripts in notepad on my windows machine, so they were full of line breaks. i edited them all out with vi and the script ran flawlessly. appreciate your assistance!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...