Thx, das sieht vielversprechend aus.
Ziel ist es, bestimmte Bilder die nach Tag und Zeit benannt sind, zu einem bestimten Zeitpunkt (entsprechend der Benennung) in ein vorgegebenes Verzeichniss zu kopieren.
Das sollte mit Deinem Beispiel klappen, rückmeldung gibts heute Nachmittag ☺
In genannten Verzeichniss liegen dann Bilder die als "Slideshow" in lxde als Wallpaper geladen werden
Das geht mit
Hier gab es den Hinweiss auf Leerzeichen im Namen, und den rat anstelle von
| pcmanfm -w $(find $pfad" -type f | shuf -n1)
|
besser
| find /RPB/lan-shares/programm -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
|
zu verwenden.
Jetzt hätte ich gerne eine Prüfung auf Dateitypen damit nicht z.B. versucht wird irgendeine log datei als Wallpaper zu laden.
Gruß
Jan
ps. ich wollte nicht den eindruck erwecken, das ich ein fertiges script geliefert bekommen möchte, aber evtl beschreibt das mein Ziel besser..
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247 | # Jahr
jahr=`date +"%Y"`
# Monat für log
monat=`date +"%m"`
# Kalenderwoche
kw=`date +"%V"`
# Tag im Monat
tgimonat=`date +"%d"`
# Wochentag als Zahl
wtag=`date +"%w"`
# Tag - nach Muster Mo, Di, Mi, usw.
tag=`date +"%a"`
# Stunden im Format 01, 02, 03, etc.
stunde=`date +"%H"`
# Minuten im Format 01, 02, 03, etc.
minute=`date +"%M"
# sec
sec=`date +%S`
mkdir -p /RPB/log/$jahr-$monat
echo "Suche nach User-Pics in $pfad/Audio/kw$kw mit String"
echo "$tag $stunde $minute"
# suche nach datei welche aktuellen Tag, und Uhrzeit im namen hat,
# und kopiere in tv-tmp
find $pfad/Audio/*$kw* -type f -iname "*$tag*$stunde*$minute*.jpg" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
find $pfad/Audio/*$kw* -type f -iname "*$tag*$stunde*$minute*.jpeg" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
find $pfad/Audio/*$kw* -type f -iname "*$tag*$stunde*$minute*.bmp" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
find $pfad/Audio/*$kw* -type f -iname "*$tag*$stunde*$minute*.png" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
# nur zum auswerten - wenn leer suche im hv
matchfile_user=`find /RPB/tv-tmp -type f -iname "*$tag*$stunde*$minute*"`
# wenn keine passende Daten gefunden werden..
if [ -z "$matchfile_user" ];
then
echo "Keine Passenden Dateien gefunden."
echo "Suche in $pfad/Audio Datei mit String"
echo "$tag $stunde $minute"
find $pfad/Audio -maxdepth 1 -type f -iname "*$tag*$stunde*$minute*.jpg" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
find $pfad/Audio -maxdepth 1 -type f -iname "*$tag*$stunde*$minute*.jpeg" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
find $pfad/Audio -maxdepth 1 -type f -iname "*$tag*$stunde*$minute*.bmp" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
find $pfad/Audio -maxdepth 1 -type f -iname "*$tag*$stunde*$minute*.png" -print0 | xargs -0 -I{} cp {} $tv_user_pics/ >/dev/null 2>&1
fi
if [ -z "$matchfile_user" ];
then
echo "Keine User-Pics gefunden."
else
echo "UserPics vorhanden!"
echo "Gefunden: $matchfile_user"
echo "Meldung: Die Datei \"$matchfile_user\" wurde in das TV-Programm geladen. $jahr-$monat-$tgimonat $stunde:$minute Uhr. Wochentag: $tag, Kalenderwoche $kw. " >> /RPB/log/$jahr-$monat/"$tgimonat.$monat.$jahr (kw$kw) - $stunde.$minute Uhr - Info - Benutzerbild.log"
fi
#suche programm
#suche im programmordner
echo "Suche in $pfad/TV/Programm/kw$kw nach Programm Datei."
matchfile_prog=`find $pfad/TV/Programm/*$kw* -type f`
folder_prog=`find $pfad/TV/Programm/*$kw* -maxdepth 0 -type d`
# wenn keine passende Daten gefunden werden..
if [ -z "$matchfile_prog" ];
then
echo "Keine Passenden Dateien gefunden."
echo "Suche in $pfad/TV/Programm nach Programm Datei"
matchfile_prog=`find $pfad/TV/Programm -maxdepth 1 -type f`
folder_prog=$pfad/TV/Programm
fi
if [ -z "$matchfile_prog" ];
then
echo "Keine Programm Datei gefunden."
else
echo "Programm Datei vorhanden!
"
echo "Gefunden: $matchfile_prog."
echo "
"
echo "
"
fi
# suche tops
echo "
"
echo "Suche in $pfad/TV/Tops/kw$kw nach Tops."
matchfile_top=`find $pfad/TV/Tops/*$kw* -type f`
folder_top=`find /RPB/lan-shares/TV/Tops/*$kw* -maxdepth 0 -type d`
# wenn keine passende Daten gefunden werden..
if [ -z "$matchfile_top" ];
then
echo "
"
echo "Keine Passenden Tops gefunden."
echo "Suche in $pfad/TV/Tops nach Tops."
matchfile_top=`find $pfad/TV/Tops -maxdepth 1 -type f`
folder_top=$pfad/TV/Tops
fi
if [ -z "$matchfile_top" ];
then
echo "
"
echo "Keine Tops gefunden."
echo "
"
echo "
"
else
echo "Tops vorhanden!
"
echo "Gefunden: $matchfile_top."
echo "
"
echo "
"
fi
#prüfung auf userpics
matchfile_user=`find /RPB/tv-tmp -type f -iname "*.*"`
# kein prog = ausfall
if [ -z "$matchfile_prog" ];
then
echo "Kein Programm - Ausfallbild wird geladen.."
echo "
"
find /RPB/tv-fail -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
echo "## Warnung: Es ist kein TV-Programm vorhanden. es wurde das Ausfallbild geladen! $jahr-$monat-$tgimonat $stunde:$minute.$sec Uhr. Wochentag: $tag, Kalenderwoche $kw. ##" >> /RPB/log/$jahr-$monat/"$tgimonat.$monat.$jahr (kw$kw) - $stunde.$minute Uhr - WARNUNG - Kein TV-Programm vorhanden.log"
fi
# nur programm - 45sec
if [ -n "$matchfile_prog" ] && [ -z "$matchfile_top" ] && [ -z "$matchfile_user" ];
then
echo "nur Programm"
echo "
"
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 5
find $pfad/TV/Programm -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
fi
#nur programm und top - 54sec
if [ -n "$matchfile_prog" ] && [ -n "$matchfile_top" ] && [ -z "$matchfile_user" ];
then
echo "Programm und Tops"
echo "
"
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $folder_top -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $folder_top -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_top -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
fi
#programm, top und user - 53sec -7
if [ -n "$matchfile_prog" ] && [ -n "$matchfile_top" ] && [ -n "$matchfile_user" ];
then
echo "Programm, Tops und User"
find $tv_user_pics -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_top -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $tv_user_pics -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $tv_user_pics -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_top -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
fi
#nur programm und user - 57sec -5
if [ -n "$matchfile_prog" ] && [ -z "$matchfile_top" ] && [ -n "$matchfile_user" ];
then
echo "Programm und Userpics"
find $tv_user_pics -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $tv_user_pics -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $tv_user_pics -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 9
find $tv_user_pics -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
sleep 8
find $folder_prog -maxdepth 1 -type f -print0 | shuf -zn1 | xargs -r0 pcmanfm -w
fi
echo "beende"
echo "## Info: tv-screens ist fertig. $jahr-$monat-$tgimonat $stunde:$minute.$sec Uhr. Wochentag: $tag, Kalenderwoche $kw. ##" >> /RPB/log/$jahr-$monat/"$tgimonat.$monat.$jahr (kw$kw) - $stunde.$minute Uhr - Info - tv-screens done.log"
pkill -x tv-screens
exit
|
und jetzt schlagt mich.. 😉