-
Notifications
You must be signed in to change notification settings - Fork 0
/
ds_store_cleanup-unmenu-package.conf
101 lines (98 loc) · 7.96 KB
/
ds_store_cleanup-unmenu-package.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#UNMENU_RELEASE $Revision$ $Date$
PACKAGE_NAME DS_Store and ._ file cleanup script
PACKAGE_DESCR The purpose of this script is to remove the .DS_Store, .Trashes, .fseventsd and ._ files that Mac OS X creates
PACKAGE_DESCR when viewing a file through Finder. Please see the <A HREF="http://en.wikipedia.org/wiki/Cron" target="_blank">wikipedia entry on Cron</A>
PACKAGE_DESCR to get a better idea on how cron works. <b>There is no error checking for the removal time entered, so please be careful
PACKAGE_DESCR when entering your desired time.
PACKAGE_URL none
PACKAGE_FILE ds_store_cleanup
PACKAGE_INSTALLED /var/log/ds_store_cleanup
PACKAGE_DEPENDENCIES none
PACKAGE_VARIABLE Remove .DS_Store schedule||vDS_REMOVAL_TIME=42 3 * * *||If blank, this removal will not be run. If set to a valid "crontab" time, it will be scheduled.
PACKAGE_VARIABLE Remove ._"file" schedule||vUSF_REMOVAL_TIME=42 3 * * *||If blank, this removal will not be run. If set to a valid "crontab" time, it will be scheduled.
PACKAGE_VARIABLE Remove .Spotlight-V100 schedule||vSPOTLIGHT_REMOVAL_TIME=42 3 * * *||If blank, this removal will not run. If set to a valid "crontab" time, it will be scheduled.
PACKAGE_VARIABLE Remove .Trashes schedule||vTRASHES_REMOVAL_TIME=42 3 * * *||If blank, this removal will not run. If set to a valid "crontab" time, it will be scheduled.
PACKAGE_VARIABLE Remove .fseventsd schedule||vFSEVENTSD_REMOVAL_TIME=42 3 * * *||If blank, this removal will not run. If set to a valid "crontab" time, it will be scheduled.
PACKAGE_VARIABLE List deleted files||vPrint=0||If set to 0 (default) then no listing of deleted files will occur, if set to 1 then a listing of files deleted will be mailed to the root user by the cron process.
PACKAGE_INSTALLATION crontab -l | egrep -v "(DS_Store files|\".DS_Store\" -depth|Removing ._ files|-name \"._\*\" -depth|Spotlight-V100 folders|\".Spotlight-V100\" -depth|Trashes folders|\".Trashes\" -depth|fseventsd folders|\".fseventsd\" -depth)" >/tmp/crontab
PACKAGE_INSTALLATION
PACKAGE_INSTALLATION if [ "${vDS_REMOVAL_TIME}" != "" -a "`echo \"${vDS_REMOVAL_TIME}\"|wc -w`" != 5 ]; then
PACKAGE_INSTALLATION echo "${vDS_REMOVAL_TIME} is not a valid <b>crontab</b> time."
PACKAGE_INSTALLATION echo "No changes made."
PACKAGE_INSTALLATION exit
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vUSF_REMOVAL_TIME}" != "" -a "`echo \"${vUSF_REMOVAL_TIME}\"|wc -w`" != 5 ]; then
PACKAGE_INSTALLATION echo "${vUSF_REMOVAL_TIME} is not a valid <b>crontab</b> time."
PACKAGE_INSTALLATION echo "No changes made."
PACKAGE_INSTALLATION exit
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vSPOTLIGHT_REMOVAL_TIME}" != "" -a "`echo \"${vSPOTLIGHT_REMOVAL_TIME}\"|wc -w`" != 5 ]; then
PACKAGE_INSTALLATION echo "${vSPOTLIGHT_REMOVAL_TIME} is not a valid <b>crontab</b> time."
PACKAGE_INSTALLATION echo "No changes made."
PACKAGE_INSTALLATION exit
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vTRASHES_REMOVAL_TIME}" != "" -a "`echo \"${vTRASHES_REMOVAL_TIME}\"|wc -w`" != 5 ]; then
PACKAGE_INSTALLATION echo "${vTRASHES_REMOVAL_TIME} is not a valid <b>crontab</b> time."
PACKAGE_INSTALLATION echo "No changes made."
PACKAGE_INSTALLATION exit
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vFSEVENTSD_REMOVAL_TIME}" != "" -a "`echo \"${vFSEVENTSD_REMOVAL_TIME}\"|wc -w`" != 5 ]; then
PACKAGE_INSTALLATION echo "${vFSEVENTSD_REMOVAL_TIME} is not a valid <b>crontab</b> time."
PACKAGE_INSTALLATION echo "No changes made."
PACKAGE_INSTALLATION exit
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ -d /mnt/cache ]; then
PACKAGE_INSTALLATION CACHE="/mnt/cache/"
PACKAGE_INSTALLATION else
PACKAGE_INSTALLATION CACHE=""
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vPrint}" -ne "1" ]; then
PACKAGE_INSTALLATION if [ "${vDS_REMOVAL_TIME}" != "" -a "`echo \"${vDS_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .DS_Store files" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vDS_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".DS_Store\" -depth -exec rm \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vUSF_REMOVAL_TIME}" != "" -a "`echo \"${vUSF_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing ._ files" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vUSF_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \"._*\" -depth -exec rm \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vSPOTLIGHT_REMOVAL_TIME}" != "" -a "`echo \"${vSPOTLIGHT_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .Spotlight-V100 folders" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vSPOTLIGHT_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".Spotlight-V100\" -depth -exec rm -r \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vTRASHES_REMOVAL_TIME}" != "" -a "`echo \"${vTRASHES_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .Trashes folders" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vTRASHES_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".Trashes\" -depth -exec rm -r \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vFSEVENTSD_REMOVAL_TIME}" != "" -a "`echo \"${vFSEVENTSD_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .fseventsd folders" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vFSEVENTSD_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".fseventsd\" -depth -exec rm -r \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION else
PACKAGE_INSTALLATION if [ "${vDS_REMOVAL_TIME}" != "" -a "`echo \"${vDS_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .DS_Store files" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vDS_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".DS_Store\" -depth -print -exec rm \"{}\" ';'" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vUSF_REMOVAL_TIME}" != "" -a "`echo \"${vUSF_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing ._ files" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vUSF_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \"._*\" -depth -print -exec rm \"{}\" ';'" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vSPOTLIGHT_REMOVAL_TIME}" != "" -a "`echo \"${vSPOTLIGHT_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .Spotlight-V100 folders" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vSPOTLIGHT_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".Spotlight-V100\" -depth -print -exec rm -r \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vTRASHES_REMOVAL_TIME}" != "" -a "`echo \"${vTRASHES_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .Trashes folders" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vTRASHES_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".Trashes\" -depth -print -exec rm -r \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION if [ "${vFSEVENTSD_REMOVAL_TIME}" != "" -a "`echo \"${vFSEVENTSD_REMOVAL_TIME}\"|wc -w`" = 5 ]; then
PACKAGE_INSTALLATION echo "# Removing .fseventsd folders" >>/tmp/crontab
PACKAGE_INSTALLATION echo "${vFSEVENTSD_REMOVAL_TIME} find /mnt/disk[1-9]*/ $CACHE /boot -name \".fseventsd\" -depth -print -exec rm -r \"{}\" ';'>/dev/null 2>&1" >>/tmp/crontab
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION fi
PACKAGE_INSTALLATION crontab /tmp/crontab
PACKAGE_INSTALLATION test -f /var/spool/cron/crontabs/root- && cp /tmp/crontab /var/spool/cron/crontabs/root-
PACKAGE_INSTALLATION echo "Version: 1.6" >/tmp/ds_store_cleanup
PACKAGE_VERSION_TEST grep "Version:" /tmp/ds_store_cleanup | awk '{print $2}'
PACKAGE_VERSION_STRING 1.5
PACKAGE_MEMORY_USAGE Small
PACKAGE_OS any