
Directory cleaner and files organizer
Source (link to git-repo or to original if based on someone elses unmodified work):
Usage for command line script:
There are two options available, standard cleaning and advanced. Command for standard cleaning is as follow:
[quote]sh cmd_cleaner s /home/user/Downloads[/quote]
for advanced only the letter "s" is changed to letter "a" like this:
[quote]sh cmd_cleaner a /home/user/Downloads[/quote]
To run with standard cleaning use the letter "s" and destination, for advanced use the letter "a" and destination.
Directory cleaner and files organizer is an intelligent tool to clean the directory and move files to preselected folders.Perfect for cleaning of directories with lot of different files
The script recognizes more than 470 extensions.
Usage: you have two options to use it.
The first one as portable app, here you need to be careful, if you run it to clean the same directory, in which the script is located, the script will be moved
Second option is by running install.sh to install it systemwide and you will have it in the menu under accessories.
For secure usage the second option is recommended.
Extra: .desktop files are securely kept back, so you can clean your desktop without any danger
Notice: In first run go to the "Edit-Settings" to see which folders are used for files. You can edit it, if you want to use other locations. If you will keep it and some of folders do not exist, they will be created automatically. Remember the following:
paths for directories must be in the exact order, with notice text in top as shown in the example below
Example:
Line 1: Notice text
Line 2: -----------
Line 3: /path/to/imagesdirectory
Line 4: /path/to/musicdirectory
Line 5: /path/to/documentsdirectory
Line 6: /path/to/videosdirectory
Line 7: /path/to/archivesdirectory
Line 8: /path/to/scriptsdirectory
(of course without the words: Line and number, this is just for example, running the "edit settings" you will see the required output.
2.2 option for more complex organizing (e.g. scripts are organized by extension inside the script folder are created folders by extensions which was detected and here are moved the corresponding files, folder py contains python scripts) + added some additional extensions
2.1 avoided an overwriting of files. If filename exist, then into the name is added timestamp and just after that is moved
2.0 fix for files with blanks
1.9 code reducing and some modifications with .desktop files
1.8 minor changes in install.sh to fix .desktop file for .local folder (moved from fcleaner file, so this can be used as portable without creating a menu item)
1.7 prepared for correct updates to higher version
1.6 changed terminal=true in .desktop file to terminal=false
Ratings & Comments
8 Comments
Great work. It would be great to also add command line options so the script could be ran in a cron job...
Thank for the comment, the command line option is an good idea. I will try to do it as soon as possible..
Thanks!
Any news on this?
sorry for the delay, I am working lot of time on WDT project, but the command line version is now available
Thank you!
Even though it seems to work, upon running it I get a few hundred errors :) Here's an excerpt: andrei@andrei-desktop:~/Desktop$ ./cmd_cleaner a /home/andrei/Desktop a /home/andrei/Desktop mv: cannot stat `total': No such file or directory mv: cannot stat `1108': No such file or directory mv: invalid option -- 'r' Try `mv --help' for more information. mv: cannot stat `1': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `2090': No such file or directory mv: cannot stat `2010-12-09': No such file or directory mv: cannot stat `20:40': No such file or directory mv: invalid option -- 'r' Try `mv --help' for more information. mv: cannot stat `1': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `11148': No such file or directory mv: cannot stat `2010-12-09': No such file or directory mv: cannot stat `19:57': No such file or directory mv: cannot move `eas1g6.jpg' to `/home/andrei/Archives/jpg/eas1g6.jpg': No such file or directory mv: invalid option -- 'r' Try `mv --help' for more information. mv: cannot stat `1': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `24288': No such file or directory mv: cannot stat `2010-12-09': No such file or directory mv: cannot stat `20:10': No such file or directory mv: cannot move `jurnalul.xcf' to `/home/andrei/Archives/xcf/jurnalul.xcf': No such file or directory mv: invalid option -- 'r' Try `mv --help' for more information. mv: cannot stat `1': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `andrei': No such file or directory mv: cannot stat `53638': No such file or directory mv: cannot stat `2010-12-09': No such file or directory mv: cannot stat `20:27': No such file or directory mv: cannot move `libgnome2-vte-perl_0.09-1_i386.deb' to `/home/andrei/Archives/deb/libgnome2-vte-perl_0.09-1_i386.deb': No such file or directory
the cleaning is working without problem, the error are the second checking result, when the document is already moved. The same is also in the classic cleaner. I will look at this later and will to rewrite it for output without errors