{"id":1382,"date":"2018-04-02T12:27:24","date_gmt":"2018-04-02T04:27:24","guid":{"rendered":"http:\/\/www.yaoge123.com\/blog\/?p=1382"},"modified":"2019-01-17T11:43:41","modified_gmt":"2019-01-17T03:43:41","slug":"seafile%e9%9b%86%e6%88%90%e5%8d%a1%e5%b7%b4%e6%96%af%e5%9f%ba","status":"publish","type":"post","link":"https:\/\/www.yaoge123.com\/blog\/archives\/1382","title":{"rendered":"Seafile\u96c6\u6210\u5361\u5df4\u65af\u57fa"},"content":{"rendered":"<p>\u9632\u75c5\u6bd2\u811a\u672c \/opt\/kaspersky\/kav4fs_scan.sh<\/p>\n<pre class=\"lang:sh decode:true  \">#!\/bin\/bash\n\nVIRUS_FOUND=1\nCLEAN=0\nUNDEFINED=2\nKAV4FS='\/opt\/kaspersky\/kav4fs\/bin\/kav4fs-control'\nif [ ! -x $KAV4FS ]\nthen\n    echo \"Binary not executable\"\n    exit $UNDEFINED\nfi\n\nSCAN_OUTPUT=`$KAV4FS --scan-file \"$1\"`\nif [ \"$?\" -ne 0 ]\nthen\n    echo \"Error due to check file '$1'\"\n    exit 3\nfi\n\nwhile read line\ndo\n\tOUT1=`echo $line|cut -d':' -f 1`\n\tOUT2=`echo $line|cut -d':' -f 2|sed 's\/ \/\/g'`\n\tcase \"$OUT1\" in\n        \"Threats found\" )\n                THREATS_C=$OUT2\n                ;;\n        \"Riskware found\" )\n                RISKWARE_C=$OUT2\n                ;;\n        \"Infected\" )\n                INFECTED=$OUT2\n                ;;\n        \"Suspicious\" )\n                SUSPICIOUS=$OUT2\n                ;;\n        \"Scan errors\" )\n                SCAN_ERRORS_C=$OUT2\n                ;;\n        \"Password protected\" )\n                PASSWORD_PROTECTED=$OUT2\n                ;;\n        \"Corrupted\" )\n                CORRUPTED=$OUT2\n                ;;\n\tesac\ndone &lt;&lt;&lt; \"$SCAN_OUTPUT\"\n\nif [ $INFECTED -gt 0 ]\nthen\n    exit $VIRUS_FOUND\nelif [ $THREATS_C -gt 0 -o $RISKWARE_C -gt 0 -o $SUSPICIOUS -gt 0 -o $SCAN_ERRORS_C -gt 0 -o $CORRUPTED -gt 0 ]\nthen\n    exit $UNDEFINED\nelse\n    exit $CLEAN\nfi<\/pre>\n<p>\/opt\/seafile\/conf\/seafile.conf \u6dfb\u52a0\u9632\u75c5\u6bd2\u914d\u7f6e<\/p>\n<pre class=\"lang:sh decode:true \">[virus_scan]\nscan_command = \/opt\/kaspersky\/kav4fs_scan.sh\nvirus_code = 1\nnonvirus_code = 0\nscan_interval = 60<\/pre>\n<p>\u6bcf\u5929crontab\u6e05\u9664kav4fs\u7684\u65e5\u5fd7\/etc\/cron.d\/kav<\/p>\n<pre class=\"lang:sh decode:true \">30 0 * * * root find \/var\/log\/kaspersky\/kav4fs\/supervisor_trace.log* -exec rm {} \\;\n40 0 * * * root \/opt\/kaspersky\/kav4fs\/bin\/kav4fs-control -S --clean-stat<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9632\u75c5\u6bd2\u811a\u672c \/opt\/kaspersky\/kav4fs_scan.sh #!\/bin\/bash VIRUS_F [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[85,8],"tags":[224],"class_list":["post-1382","post","type-post","status-publish","format-standard","hentry","category-it","category-network","tag-seafile"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paOwEq-mi","_links":{"self":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts\/1382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/comments?post=1382"}],"version-history":[{"count":4,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts\/1382\/revisions"}],"predecessor-version":[{"id":1434,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts\/1382\/revisions\/1434"}],"wp:attachment":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/media?parent=1382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/categories?post=1382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/tags?post=1382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}