Sponsored Content
Operating Systems OS X (Apple) Deleting a recursive symbolic link was a very bad idea Post 302312261 by timgolding on Thursday 30th of April 2009 07:02:58 PM
Old 04-30-2009
Deleting a recursive symbolic link was a very bad idea

Well i was tidying up some files in a very important directory on our development server and somehow some plank had put a recursive sybmolic link in it. Which I the even bigger plank tried to delete from my FTP client. My FTP client then thought it would be OK to delete not only the sybmolic link but also the entire directory that it was pointing to (which happened to be the very important directory). Smilie <- This smiley isnt angry enough for how I feel. The situation became a lot worse when i realised the external backup disk was not plugged in and now doesn't work. I looked at my backup logs and realised the last time the directory was backed up was on September 2008. My biggest concern is the admin control panel which controls all administration of our sites. Which i have made many additions too since Sept 2008. I can't even mount the external drive it beeps horribly at me. Luckily my backup script tars the folders its backing up before copyint them to the backup disk so I can get to the Sept 2008 copy of that folder. However I'm reluctant to restore the folder to that date just yet. Because before I make any new files on this directory I need to look into data recovery for MAC OS X 10.3.9. I need to know if there is any FREE way to recover deleted files on this drive? The drive isn't the primary partition luckily so i doubt hardly any files have been written to it and will be. I downloaded the only Free thing i could find called testdisk-6.11.2 which comes with photrec which looked ideal. Whilst it works on my laptop Mac OS X 10.4.11 it doesn't work on my server complains like so

Code:
./photorec undefined reference to _uuid_generate expected to be defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap

Smilie My company won't really allow me any down time as it's out mail server. They'll lose money and since in the current economic climate they were too hard up to even buy me a new backup disk when i asked I can't see it happening. So I can't even really take the disks out and connect them to the laptop to do the recovery with this software. Does anyone know if I can get this working somehow on the server? Or if there are any other similar utilities that will work with MAC OS X 10.3.9? Another thing I wondered is if there is a way to copy all the unused sectors of partition B to Partition A? I looked on google and not many people are interested in backing up unused sectors (would seem pointless to most). Well i really need any advise I can get at this time. And could someone tell me why I can't delete recursive symbolic links the way I did and how should I delete them should I find any more? I'm really considering going and buying my very own huge external USB disk this weekend and ghosting the disks. Then running the other utility from the laptop on those disks (I kind of need a personal external disk for my home PC anyway). So my final question is is there a disk cloning utility out there that will copy the whole disk unused sectors included?

I'm angry at myself, unix, my ftp client, my empty .Trash, My boss, The External Disk and the person who put the file there Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"recursive" symbolic link

I have a directory in system that has a symbolic link to itself. Can't rm (device busy error), mv (device busy error), etc. Cannot seem to access directory. Trying to see process using file (fuser) returns "too many levels of symbolic links) Any help on removing this would be appreciated.... (1 Reply)
Discussion started by: nneilitz
1 Replies

2. UNIX for Dummies Questions & Answers

symbolic Link

question abt symbolic link ... i'm doing the following ... ln -s x.sh ./scripts/y.sh and cat ./scripts/y.sh it is giving following error cat: cannot open y.sh Any reason u an think of ? But it is working fine when i goto scripts directory and cretae the symbolic link. ... (1 Reply)
Discussion started by: bhargav
1 Replies

3. Shell Programming and Scripting

Limitations of awk? Good idea? Bad idea?

Keeping in mind that I'm relatively comfortable with programming in general but very new to unix and korn/bourne shell scripts.. I'm using awk on a CSV file, and then performing calculations and operations on specific fields within specific records. The CSV file I'm working with has about 600... (2 Replies)
Discussion started by: yongho
2 Replies

4. Shell Programming and Scripting

using case to do this might be a bad idea?

Reading this file. I want to read all 4 fields. If 2 is populated with a p, I want to set $TYPEP to "Printers", if not should be empty. If 3 is populated with an r, I want to set $TYPER to "REQ Printers" if not should be empty. If 4 is populated with letter o, I want to set $TYPEO to... (12 Replies)
Discussion started by: Skyybugg
12 Replies

5. UNIX for Dummies Questions & Answers

need some info about symbolic link and hard link

hello folks how y'all doin well i have some questions about symbolic link and hard link hope some one answer me i open terminal and join as root and i wrote ln -s blah blah then i wrote ls i see red file called blah blah but didn't understand what is this can some one explain and... (2 Replies)
Discussion started by: detective linux
2 Replies

6. Shell Programming and Scripting

Symbolic Link Help

Hello All, This may be a silly question to some but I am really stuck. Is there a way to reverse the following; sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh It was part of a driver compile/installation procedure by Digi for Ubuntu stating that dash isn't supported and a symbolic link... (2 Replies)
Discussion started by: LAVco
2 Replies

7. Red Hat

Is overlapping two RAID5 arrays on same drives a bad idea ??

is placing two RAID5 arrays on disk as shown below Is advisable? Will this create performance problems? sda-(500GB) sdb-(1TB) sdc-(1TB) sdd-(1TB) (250MB)----------(250MB) ---------unused------------unused------->(/dev/md0) RAID1 ... (6 Replies)
Discussion started by: Saed
6 Replies

8. Shell Programming and Scripting

ls on a symbolic link

Hi all, Can anyone please confirm if the command below is the only way that I can get what the symbolic link is set to? mnlxd110(oracle)/db/posd2/dba$: ls -l | grep "^l" lrwxrwxrwx 1 oracle dba 28 Aug 9 2011 bdump -> diag/rdbms/posp1/posp1/trace mnlxd110(oracle)/db/posd2/dba$:... (7 Replies)
Discussion started by: newbie_01
7 Replies

9. UNIX for Dummies Questions & Answers

[Solved] Symbolic link not allowed or link target not accessible

Hi everybody, I read about treads realted to this issue but they did not resovle issue given below. Please help me resolve issue given below I have html file under /srv/www/htdocs/actual_folder ls actual_folder/ test.html and following link works... (0 Replies)
Discussion started by: newbielgn
0 Replies

10. UNIX for Dummies Questions & Answers

Symbolic link

Hi, trying to understand more about symblic link, when I compiled a program called "match" in one folder ~/downloadsoftware/I want this program to be accessible like a system command by putting a symbolic link in /usr/bin/ Not by setting the $PATH method in .bashrc at this time. What I did is:... (4 Replies)
Discussion started by: yifangt
4 Replies
LNDIR(1)						      General Commands Manual							  LNDIR(1)

NAME
lndir - create a shadow directory of symbolic links to another directory tree SYNOPSIS
lndir [ -silent ] [ -ignorelinks ] [ -withrevinfo ] fromdir [ todir ] DESCRIPTION
The lndir program makes a shadow copy todir of a directory tree fromdir, except that the shadow is not populated with real files but instead with symbolic links pointing at the real files in the fromdir directory tree. This is usually useful for maintaining source code for different machine architectures. You create a shadow directory containing links to the real source, which you will have usually mounted from a remote machine. You can build in the shadow tree, and the object files will be in the shadow directory, while the source files in the shadow directory are just symlinks to the real files. This scheme has the advantage that if you update the source, you need not propagate the change to the other architectures by hand, since all source in all shadow directories are symlinks to the real thing: just cd to the shadow directory and recompile away. The todir argument is optional and defaults to the current directory. The fromdir argument may be relative (e.g., ../src) and is relative to todir (not the current directory). Note that BitKeeper, RCS, SCCS, .svn, CVS and CVS.adm directories are shadowed only if the -withrevinfo flag is specified. If you add files, simply run lndir again. New files will be silently added. Old files will be checked that they have the correct link. Deleting files is a more painful problem; the symlinks will just point into never never land. If a file in fromdir is a symbolic link, lndir will make the same link in todir rather than making a link back to the (symbolic link) entry in fromdir. The -ignorelinks flag changes this behavior. OPTIONS
-silent Normally lndir outputs the name of each subdirectory as it descends into it. The -silent option suppresses these status messages. -ignorelinks Causes the program to not treat symbolic links in fromdir specially. The link created in todir will point back to the corresponding (symbolic link) file in fromdir. If the link is to a directory, this is almost certainly the wrong thing. This option exists mostly to emulate the behavior the C version of lndir had in X11R6. Its use is not recommended. -withrevinfo Causes any BitKeeper, RCS, SCCS, .svn, CVS and CVS.adm subdirectories to be treated as any other directory, rather than ignored. DIAGNOSTICS
The program displays the name of each subdirectory it enters, followed by a colon. The -silent option suppresses these messages. A warning message is displayed if the symbolic link cannot be created. The usual problem is that a regular file of the same name already exists. If the link already exists but doesn't point to the correct file, the program prints the link name and the location where it does point. X Version 11 lndir 1.0.1 LNDIR(1)
All times are GMT -4. The time now is 05:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy