boto_rsync icon indicating copy to clipboard operation
boto_rsync copied to clipboard

crashes on borken symlinks

Open ckelty opened this issue 11 years ago • 3 comments

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$

ckelty avatar Apr 17 '13 00:04 ckelty

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

seedifferently avatar Apr 17 '13 15:04 seedifferently

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.

coderpete avatar Jun 06 '13 22:06 coderpete

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

zackse avatar Mar 03 '15 17:03 zackse