Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashes on borken symlinks #14

Open
ckelty opened this issue Apr 17, 2013 · 3 comments
Open

crashes on borken symlinks #14

ckelty opened this issue Apr 17, 2013 · 3 comments

Comments

@ckelty
Copy link

ckelty commented Apr 17, 2013

This tools is fantastic-- but it seems crash on broken symlinks. Telling it to ignore 0 byte files doesn't solve it, since the symlinks are not 0 bytes. Maybe I'm missing something...

www/boi-cms.old/taps_ctrl.sh
Traceback (most recent call last):
File "/usr/local/bin/boto-rsync", line 1150, in
main()
File "/usr/local/bin/boto-rsync", line 544, in main
file_size = os.path.getsize(fullpath)
File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/var/www/boi-cms.old/current'
Scanning for files to transfer...
shells
Muttrc
pam.conf
nanorc
legal
Traceback (most recent call last):
File "/usr/local/bin/boto-rsync", line 1150, in
main()
File "/usr/local/bin/boto-rsync", line 544, in main
file_size = os.path.getsize(fullpath)
File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/etc/blkid.tab'
ckelty@beadle:/etc/backup$ ls -al /etc/blkid.
blkid.conf blkid.tab
ckelty@beadle:/etc/backup$ ls -al /etc/blkid.tab
lrwxrwxrwx 1 root root 15 2011-07-23 16:47 /etc/blkid.tab -> /dev/.blkid.tab
ckelty@beadle:/etc/backup$ ls -al /var/www/boi-cms.old/current
lrwxrwxrwx 1 capistrano www-data 40 2012-04-12 14:20 /var/www/boi-cms.old/current -> /var/www/boi-cms/releases/20120412212119
ckelty@beadle:/etc/backup$

@seedifferently
Copy link
Owner

Thanks, I'll check it out when I finally get back to updating this project.

@coderpete
Copy link

In the meantime, should anyone come here for answers as I did, you can remove broken symlinks with

find -L /dir/to/traverse -type l -delete

Notes:
run without the "-delete" for a listing
works for me on mac osx and debian
source: http://www.commandlinefu.com/commands/view/2369/find-broken-symlinks-and-delete-them

HTH,
Pete.

zackse pushed a commit to zackse/boto_rsync that referenced this issue Mar 3, 2015
This will continuing processing after a stat() failure, e.g., due to a broken
symlink.
@zackse
Copy link

zackse commented Mar 3, 2015

You can avoid purging dangling symlinks by applying zackse/boto_rsync@1813325, which will skip any files that cannot be stat()'ed.

zackse added a commit to zackse/boto_rsync that referenced this issue Mar 3, 2015
This will continuing processing after a stat() failure, e.g., due to a broken
symlink.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants