
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
A short script to scan files or directories with ClamAV.
It provides the ability to scan multiple files, a progress-dialog and a result window.
Installation:
1. Start Dollphin
2. Press "Configure and control Dolphin" > "Configure Dolphin..."
3. Go to "Services"
4. "Download New Services..."
5. Search for my scripts name
6. Press "Install"
You need to have ClamAV installed.
If you encounter any issues when using the graphical way extract the file and run "sh install.sh".
All files are installed in the users home directory (/home/[user]/.kde[4]/share/kde4/services/ServiceMenus/ClamScan/), there is no need to use su or sudo to install
Note:
The script is currently translated in English, Finnish, French, German, Indonesian, Italian, Russian, Spanish, Swedish, Turkish and Ukrainian.
If you wish another language, translate the following and leave me a message or write it in a comment:
Name[en]=Scan with ClamAV
wait="ClamAV is scanning, please wait."
not_found="ClamAV is not installed!"
scan_sentence="Scanning files: "
Translations:
English Finnish (Thanks to nikore90)French (Thanks to pbuard)GermanIndonesian (Thanks to JamurBulet)Italian (Thanks to Andrea Sciucca)Russian (Thanks to Omega9)SpanishSwedish (Thanks to Jonas Norlander)Turkish (Thanks to tanzer)Ukrainian (Thanks to Localizator (localizator@ukr.net))
7 years ago
2013-6-18 (2.5.7)
- fixed permissions
2012-9-16 (2.5.6)
- fix: install-script: create path2 if it doesn't exist
2012-4-21 (2.5.5)
- support for linked directories
- support for empty directories
- unnecessary logfile gets deleted after scan, only result file remains
- fixed some if-conditions
- counts directories
2012-4-19 (2.5.4)
- fixed a wrong directory test (minor bug); now [ -d ] instead of [ -f ]
- did some testing on the mountable devices .desktop file, seems to work fine now
2012-4-19 (2.5.3)
- fixed a wrong set directory (~/.kde4/...) (that was for testing, I forgot to remove it)
- added spanish
- fixed this bug: gentooforum.de/artikel/17867/2/update-script.html when running ClamScan.sh without syntax
2012-2-23 (2.5.2)
- fixed recognition of empty directories which I broke in 2.3
2012-2-23 (2.5.1)
- Indonesian translation
2012-2-4 (2.5)
- using mkdir -p instead of if-conditions
(See Changelog file)
Don't forget to vote!
7 years ago
2013-6-18 (2.5.7)
- fixed permissions
2012-9-16 (2.5.6)
- fix: install-script: create path2 if it doesn't exist
2012-4-21 (2.5.5)
- support for linked directories
- support for empty directories
- unnecessary logfile gets deleted after scan, only result file remains
- fixed some if-conditions
- counts directories
2012-4-19 (2.5.4)
- fixed a wrong directory test (minor bug); now [ -d ] instead of [ -f ]
- did some testing on the mountable devices .desktop file, seems to work fine now
2012-4-19 (2.5.3)
- fixed a wrong set directory (~/.kde4/...) (that was for testing, I forgot to remove it)
- added spanish
- fixed this bug: gentooforum.de/artikel/17867/2/update-script.html when running ClamScan.sh without syntax
2012-2-23 (2.5.2)
- fixed recognition of empty directories which I broke in 2.3
2012-2-23 (2.5.1)
- Indonesian translation
2012-2-4 (2.5)
- using mkdir -p instead of if-conditions
(See Changelog file)
Don't forget to vote!
myndstream
5 months ago
Report
luis-fessel
2 years ago
wait="O ClamAV está escaneando, por favor, aguarde."
not_found="O ClamAV não está instalado!"
scan_sentence="Escaneando arquivos: "
Report
b606
3 years ago
Report
MatTaylorSharrow
3 years ago
It would be nice to make other improvements such as perform actions on files that are found to be infected.
Report
b606
3 years ago
Report
MatTaylorSharrow
3 years ago
If you want to add to your own repo that's fine we can merge quite easily I think.
Report
b606
3 years ago
- I did not retain "kde4-config --path services" anymore but that is a good idea since some distros/apps still use it.
- I do not clamd (only occasional file scan)
- The progressbar is improved with some flaws, that is why I prefer using the inotify branch.
- the Cancel button is working afaik
Report
MatTaylorSharrow
3 years ago
https://github.com/MatTaylorSharrow/ClamAVScan-Dolphin-ServiceMenu
Report
lm789632
3 years ago
Report
mcmurchy1917
7 years ago
As I have clamd running I've amended the script ClamScan.sh to use clamdscan instead. Needed a bit of rework to cater for the differences in the information they write to the log files and of course clamd must be running.
The time to scan has reduced quite significantly. I tested on a directory with 1210 files and 9 sub-directories with a size of 3.2G, in the directory there were 19 infected files. My machine is 10 years old with P4 and 2G of memory.
Using clamscan it took on average 14 mins.
Clamdscan took on average 2.5 minutes.
Not quite sure what to do with it. Let me know whoever might be interested. It doesn't cater for symbolic links. So really this is just a heads up.
Alex
Report
Incarus
6 years ago
nohup clamscan -r --log="$spath"/ServiceMenus/ClamScan/logs/ClamScan_result_$date.log --stdout $real_files > "$spath"/ServiceMenus/ClamScan/logs/ClamScan_$date.log 2>&1 &
we could swap it to something like
if [ "$(pidof clamdscan)" ]
then
nohup clamdscan [...]
else
nohup clamscan [...]
fi
not sure if that is working.
Report
Incarus
6 years ago
A possible fix for this would be to let the script check if clamdscan is running and if yes to prefer that one.
Report
mcmurchy1917
7 years ago
However, I've noticed that the progress bar in kdialog doesn't behave correctly.
I believe this patch resolves the issue -
--- ClamScan.sh.clamscan 2013-12-04 16:28:42.137603031 +0000
+++ ClamScan.sh 2013-12-05 10:40:06.303412347 +0000
@@ -8,7 +8,7 @@
files_old=$*
IFS="," #new separator instead of spaces
files=${files_old//\ \//,\/} #from " /" to ",/"
-version="2.5.5"
+version="2.5.8"
title="ClamScan $version"
date="$(date +"%H-%M-%S_%d-%m-%Y")"
path="$(kde4-config --path services)"
@@ -85,7 +85,7 @@
current_lines="0"
progress=$(kdialog --title "$title" --progressbar "$wait
-$scan_sentence $complete_amount ($complete_amount_dir directories)")
+$scan_sentence $complete_amount ($complete_amount_dir directories)" $complete_amount)
#qdbus $progress org.kde.kdialog.ProgressDialog.showCancelButton true
else
Report
Xwang1976
6 years ago
Can you help me, please?
Report
mcmurchy1917
6 years ago
On my system it takes about 7.318 secs to load the dictionary and scan the smallest file in a directory. Whereas if I scan all 11 files in the directory clamscan takes 7.785 secs so really it takes only 0.467 secs to scan the 11 files.
How this may be represented in the progress bar is that it displays the bar waits 7.318 secs at 0% then progresses to 100% in the remaining 0.467 secs them closes. Is this what you see?
I think this was one of the reasons I swapped over to using clamdscan.
In this scenario the progress bar might not register anything for the first 7 secs and then
Report
Incarus
6 years ago
Report
mcmurchy1917
6 years ago
I understand that this is wanted behaviour and the code should be kept easily maintainable.
All I was pointing out was that there is an overhead that might suggest the progress bar is not working as designed.
So waiting for a reply from Xwang1976 to see if what they see can be explained by the above description.
Alex
Report
Incarus
6 years ago
Might be a problem with DBus.
Report
Xwang1976
6 years ago
Xwang
Report
Incarus
6 years ago
Report
Incarus
6 years ago
"$spath"/ServiceMenus/ClamScan/logs/ClamScan_$date.log
each scanned file creates exactly one new line in that file, so if the amount of lines in the file == amount of all selected files the progressbar should be 100% (or x of x files).
Does the mentioned file exist on your computer (is it creating while scanning)?
Report
Xwang1976
6 years ago
Report
webguy
7 years ago
It also doesn't display the full result of the scan, just 'Result' with a dotted line underneath. The log for the day, and the individual scan logs have the full details though.
Report
Incarus
7 years ago
Feel free to fork this project and to maintain your own script, I also changed the license to CC BY (now without SA).
Report
msx
7 years ago
Report