LoginSignup
0
1

More than 5 years have passed since last update.

Samba ファイルサーバーから .DS_Store, Thumbs.db 系のファイルを抹消する(安直編)

Last updated at Posted at 2016-12-24

つらいですねーこういうの。

[root@phy3 samba]# file ./mac20160828/Documents/pjt/pg1x/mx1/var/www/postfixadmin/._config.local.php
./mac20160828/Documents/pjt/pg1x/mx1/var/www/postfixadmin/._config.local.php: AppleDouble encoded Macintosh file
[root@phy3 samba]# file ./win10/K/Dropbox/Documents/projects/aaa_bot/.git/._sourcetreeconfig
./win10/K/Dropbox/Documents/projects/aaa_bot/.git/._sourcetreeconfig: AppleDouble encoded Macintosh file

本当は file コマンド実行した結果を判別してから消すべきなんでしょうが、 ._* で引っ掛けて消すタイプです。
cron.daily に仕込んで終わりにしました。

/etc/cron.daily/metadata-buster.sh
#!/bin/bash
find /var/samba/ -type f -name "._*" -exec rm -f {} \;
find /var/samba/ -type f -name ".DS_Store" -exec rm -f {} \;
find /var/samba/ -type f -name "Thumbs.db" -exec rm -f {} \;
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1