2
votes
1answer
464 views

Generate a list of files by piping output of find command into another find command?

I need to generate a list of files for use in a shell script. The list should be all files (in a specified directory) that are hardlinked. I want to replace the hardlinks with symlinks. (Obviously, ...
0
votes
1answer
297 views

ls link count seems incorrect - how do I ensure I'm not deleting the inode contents?

ls -lai on a file gives me a link count of 2: 16508 -rw-rw-rw- 2 ... Then looking for all the filenames returns only one: find "$dir" -inum 16508 This lists only the original file, not two. ...
0
votes
1answer
251 views

How to improve this bash shell script for turning hardlinks into symlinks?

This shell script is mostly the work of other people. It has gone through several iterations, and I have tweaked it slightly while also trying to fully understand how it works. I think I understand it ...
0
votes
1answer
1k views

Find modified files from rsync backup script

I'm using rsync on my Ububtu Linux server to take a time machine like backup of the system. Every hour, a cronjob runs the following script (partial excerpt): rsync -a --link-dest=/backup/current ...
4
votes
2answers
1k views

Unable to preserve hard links. Why?

I'm trying to create a Makefile that would automate remastering Knoppix distribution. I'm trying to copy filesystem from the read-only compressed loop device to normal filesystem to be able to modify ...
9
votes
2answers
6k views

Finding all symbolic and hard links to a file on UNIX

If I have a specific file in a UNIX filesystem, is there a way to use bash to find all links to that file, both symbolic and hard? If I need different commands for each, what are they?