@__thumb files - How do do I get rid of them?

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
doubter13
Starting out
Posts: 31
Joined: Wed Sep 09, 2009 2:08 pm

Re: @__thumb files - How do do I get rid of them?

Post by doubter13 »

Kronissimo54 wrote:Hello,

the script didn't work for me.

I have installed Phyton over the Web-Adimistration with "Get QPKG" and activated it.

Then, i tried to start the script in Putty, but just became this message:

Code: Select all

[/share/Medien] # python rmthumb.py
  File "rmthumb.py", line 1
    import os, shutil
    ^
IndentationError: unexpected indent
I named the script "rmthum.py", and created it with WinSCP in /share/Medien.

How can i get it started?
Have the same problem...
did you figure it out?
QNAP TS-470 Pro [4.3.6.1333 (2020/06/08)]
- disks: 4xWD30EFRX-68EUZN0 3TB, ext3
- SSD: 2xSAMSUNG SSD 850 EVO 1000GB
doubter13
Starting out
Posts: 31
Joined: Wed Sep 09, 2009 2:08 pm

Re: @__thumb files - How do do I get rid of them?

Post by doubter13 »

found the problem myself
there was a problem with the coding
somehow the file i created had DOS encoding, not unix
i also deleted some spaces in front of "import os, shutil"
now it is working
QNAP TS-470 Pro [4.3.6.1333 (2020/06/08)]
- disks: 4xWD30EFRX-68EUZN0 3TB, ext3
- SSD: 2xSAMSUNG SSD 850 EVO 1000GB
User avatar
Toxic17
Ask me anything
Posts: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: @__thumb files - How do do I get rid of them?

Post by Toxic17 »

voxtreet wrote: - Log onto your QNAP machine (I use SSH)
- Navigate to the directory under which you want to delete all thumbnails
- Create a new file called rmthumbnails.py
- Copy and paste the following code into that file

Code: Select all

import os, shutil

for root, dirs, files in os.walk('.', topdown=False):
        print "Root: %s" % root
        for dir in dirs:
                if dir == '.@__thumb':
                        delpath = os.path.join(root, dir)
                        print "Removing %s" % delpath
                        shutil.rmtree(delpath)
        for file in files:
                if file == '.hightlight':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
                        os.remove(delpath)
                elif file == 'Picasa.ini':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
                        os.remove(delpath)
                elif file == 'Thumbs.db':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
- Run it!

Code: Select all

#python rmthumbnails.py
That should do it!

Thanks!
Thanks for the fix!
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
ednap
Starting out
Posts: 26
Joined: Tue Jan 06, 2015 1:07 pm

Re: @__thumb files - How do do I get rid of them?

Post by ednap »

Anybody consider using find?

find . -name ".@__thumb" -print will provide the path to all these files

if you dare you can try

find . -name ".@__thumb" -exec rm -rf {} \;

Please test wisely first.
ednap
Starting out
Posts: 26
Joined: Tue Jan 06, 2015 1:07 pm

Re: @__thumb files - How do do I get rid of them?

Post by ednap »

Anybody consider using find?

find . -name ".@__thumb" -print will provide the path to all these files

if you dare you can try

find . -name ".@__thumb" -exec rm -rf {} \;

Please test wisely first.
Yezariael75
New here
Posts: 6
Joined: Thu Apr 04, 2013 3:32 am

Re: @__thumb files - How do do I get rid of them?

Post by Yezariael75 »

No luck for me :(

If i execute the rmthumbnails.py the connection of WinSCP times out and nothing happens. If I try the find . -name ".@__thumb" -exec rm -rf {} \; command I get an error message (attached). Nonetheless, the find . -name ".@__thumb" -print command works.

What can I try next?

Thanks!
You do not have the required permissions to view the files attached to this post.
ednap
Starting out
Posts: 26
Joined: Tue Jan 06, 2015 1:07 pm

Re: @__thumb files - How do do I get rid of them?

Post by ednap »

Looks like the version of find included in the Qnap os doens't have exec..

so I guess you could pipe the output to xargs

find . -name ".@__thumb" | xargs -t rm

I suggest you test first with "ls" instead of "rm" and be very careful with this!
OsefYep
New here
Posts: 6
Joined: Fri Apr 13, 2012 6:57 pm

Re: @__thumb files - How do do I get rid of them?

Post by OsefYep »

Ok, so we have a 3 pages thread WITH NO INTERVENTION OF ANY QNAP STAFF about some ** folder/files generated at 3 am that everyone wants to remove.

I have version 4.1.3 on a TS-459 Pro+.

I don't see in the crontab file what can cause the generation. It is generated at 3 AM, but the scripts running at 3 am doesn't correspond :
# m h dom m dow cmd
0 4 * * * /sbin/hwclock -s
0 3 * * * /sbin/vs_refresh
0 3 * * 0 /etc/init.d/idmap.sh dump
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
30 3 * * * /sbin/notice_log_tool -v -R
4 3 * * 3 /etc/init.d/backup_conf.sh
30 7 * * * /usr/local/sbin/version_cleaner -t 0 > /dev/null 2>/dev/null
58 10 * * * /usr/bin/qcloud_cli -c
Batch removing the folders is trivial. I want to stop the generation.

QNAP STAFF, can we have an answer please ?
User avatar
pwilson
Guru
Posts: 22533
Joined: Fri Mar 06, 2009 11:20 am
Location: Victoria, BC, Canada (UTC-08:00)

Re: @__thumb files - How do do I get rid of them?

Post by pwilson »

OsefYep wrote:Ok, so we have a 3 pages thread WITH NO INTERVENTION OF ANY QNAP STAFF about some ** folder/files generated at 3 am that everyone wants to remove.
This is not a QNAP Support channel. If you want to contact QNAP Helpdesk staff, you can do so by submitting a ticket.

This is merely a Community Forum (check the title of this Forum). QNAP typically does not post very often to this Forum.

Patrick M. Wilson
Victoria, BC Canada
QNAP TS-470 Pro w/ 4 * Western Digital WD30EFRX WD Reds (RAID5) - - Single 8.1TB Storage Pool FW: QTS 4.2.0 Build 20151023 - Kali Linux v1.06 (64bit)
Forums: View My Profile - Search My Posts - View My Photo - View My Location - Top Community Posters
QNAP: Turbo NAS User Manual - QNAP Wiki - QNAP Tutorials - QNAP FAQs

Please review: When you're asking a question, please include the following.
wazzageek
Starting out
Posts: 28
Joined: Sun Dec 09, 2012 6:58 pm

Re: @__thumb files - How do do I get rid of them?

Post by wazzageek »

voxtreet wrote: - Log onto your QNAP machine (I use SSH)
- Navigate to the directory under which you want to delete all thumbnails
- Create a new file called rmthumbnails.py
- Copy and paste the following code into that file

Code: Select all

import os, shutil

for root, dirs, files in os.walk('.', topdown=False):
        print "Root: %s" % root
        for dir in dirs:
                if dir == '.@__thumb':
                        delpath = os.path.join(root, dir)
                        print "Removing %s" % delpath
                        shutil.rmtree(delpath)
        for file in files:
                if file == '.hightlight':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
                        os.remove(delpath)
                elif file == 'Picasa.ini':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
                        os.remove(delpath)
                elif file == 'Thumbs.db':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
- Run it!

Code: Select all

#python rmthumbnails.py
That should do it!

Thanks!
I had similar issues getting this to work as others did but eventually got it to work by dropping the # symbol from the front of the command.

So the command was as follows using the command run feature in the WinSCP terminal.

Code: Select all

python rmthumbnails.py
Cheers, Waz.
tbgoose
Starting out
Posts: 15
Joined: Mon Aug 10, 2015 1:39 pm

Re: @__thumb files - How do do I get rid of them?

Post by tbgoose »

voxtreet wrote:... I wrote a Python script to remove all those pesky "@__thumbs" thumbnails...
Cheers mate, worked a treat!
Dmitri
New here
Posts: 2
Joined: Sun Oct 18, 2015 5:44 pm

Re: @__thumb files - How do do I get rid of them?

Post by Dmitri »

If somebody will decide to delete them in DOS/Windows. This is the content of a batch file to run.

Code: Select all

 for /r %%i in (.@__thumb) do rd /s/q "%%i"
User avatar
janpolet
Easy as a breeze
Posts: 287
Joined: Fri Jun 12, 2009 5:01 pm
Location: Netherlands
Contact:

Re: @__thumb files - How do do I get rid of them?

Post by janpolet »

voxtreet wrote:Hi,

I have noticed the same thing. At first I thought it was the Multimedia Station, but even when I disabled it, they still appeared. Good to learn that it is the cron job that is creating them every night. I'm having trouble commenting out the ImR_all line in the crontab, though. I do crontab -e, and put the "#" in front of the line, then do Esc and :wq to save and exit. But the next time I look at the crontab (crontab -l) the comment isn't there anymore. Any hints?

Anyways, I wrote a Python script to remove all those pesky "@__thumbs" thumbnails under the current directory and all subdirectories. I was using this for my Photo collection, so my script also removes ".hightlight" files (what are those anyway?), Thumbs.db, and picasa.ini files, you can remove those lines if you don't care about those. It works for me, but as I'm not an official QNAP representative, USE AT YOUR OWN RISK!

- Log onto your QNAP machine (I use SSH)
- Navigate to the directory under which you want to delete all thumbnails
- Create a new file called rmthumbnails.py
- Copy and paste the following code into that file

Code: Select all

import os, shutil

for root, dirs, files in os.walk('.', topdown=False):
        print "Root: %s" % root
        for dir in dirs:
                if dir == '.@__thumb':
                        delpath = os.path.join(root, dir)
                        print "Removing %s" % delpath
                        shutil.rmtree(delpath)
        for file in files:
                if file == '.hightlight':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
                        os.remove(delpath)
                elif file == 'Picasa.ini':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
                        os.remove(delpath)
                elif file == 'Thumbs.db':
                        delpath = os.path.join(root, file)
                        print "Removing %s" % delpath
- Run it!

Code: Select all

#python rmthumbnails.py
That should do it!

Thanks!
Thanks so much! Seems to have worked like a charm! :)
MAIN NAS: QNAP TS-453D 8Gb | FW: QTS 5.1.4.2596 build 20231128 | 4 x 4Tb Seagate IronWolf Pro (ST4000NE001) in RAID5
BACKUP NAS: QNAP TS-469L | FW: QTS 4.3.4.2451 build 20230621 | 4 x 3Tb Seagate Constellation ES.3 (ST3000NM0033) in RAID5
FIRST NAS: QNAP TS-439 PRO | FW: QTS 4.2.6 build 20230621 | 4 x 1Tb Hitachi/Samsung in RAID5
User avatar
papampi
Getting the hang of things
Posts: 81
Joined: Sat Jun 06, 2015 2:52 pm
Contact:

Re: @__thumb files - How do do I get rid of them?

Post by papampi »

I just found a way to completely disable creating .@__thumb folders,
Even if you disable media folders when you open any media folder in file station it will create .@__thumb folder.
So the best way is :

Code: Select all

1- Open file station
2- Top right corner click setting icon (between help and refresh)
3- Uncheck "support multimedia playback and thumbnail display"
4- Voila .... never see   .@__thumb folders again.
I dont know what multimedia playback it disbales, I have no problem playback on kodi
Models: TVS-863, HS-251
قیمت فروش پیچ و مهره
User avatar
Toxic17
Ask me anything
Posts: 6469
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: @__thumb files - How do do I get rid of them?

Post by Toxic17 »

what does the output say when you run the command "python rmthumbnails.py" ?
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
Locked

Return to “Miscellaneous”