Hallo, waehrend der Kernel baut, habe ich noch 2 Fragen. 1) Wie setze ich am einfachsten _alle_ Files des System auf 1.1.1970 00:00 2) Wie erstelle ich am einfachsten eine Liste mit den Hashes _aller_ Files? Ich moechte spaeter schnell erkennen koennen, an welchen Stellen im System geaendert wurde. Da das System ro rennt, muss bei Aenderungen jemand Hand angelegt haben. Das hat doch sicher schon jemand gestrickt. MfG Th. Moritz -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
* Thomas Moritz
Hallo, waehrend der Kernel baut, habe ich noch 2 Fragen.
1) Wie setze ich am einfachsten _alle_ Files des System auf 1.1.1970 00:00
Ungetestet: TZ=GMT find /path/to/root -type f -exec touch -D "1970-01-01 00:00" {} \;
2) Wie erstelle ich am einfachsten eine Liste mit den Hashes _aller_ Files?
Ungetestet: find /path/to/root -type f -exec md5sum {} \; Gruß, Bernhard -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Hallo, Am Fri, 08 Apr 2011, Bernhard Walle schrieb:
* Thomas Moritz
[2011-04-08 11:51]: Hallo, waehrend der Kernel baut, habe ich noch 2 Fragen.
1) Wie setze ich am einfachsten _alle_ Files des System auf 1.1.1970 00:00
Ungetestet: TZ=GMT find /path/to/root -type f -exec touch -D "1970-01-01 00:00" {} \;
TZ=UTC find /path/ -type f -exec touch -D "1970-01-01 00:00" {} +
2) Wie erstelle ich am einfachsten eine Liste mit den Hashes _aller_ Files?
Ungetestet: find /path/to/root -type f -exec md5sum {} \;
find /path/to/root -type f -exec md5sum -b {} + > MD5SUMS -dnh -- HTML ist eigentlich nur SGML das nicht validiert. -- nach B. Wachter -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Am Freitag, 8. April 2011 11:53:56 schrieb Bernhard Walle: Hallo Bernhard, man warst Du schnell! Besten Dank!
1) Wie setze ich am einfachsten _alle_ Files des System auf 1.1.1970 00:00
Ungetestet: TZ=GMT find /path/to/root -type f -exec touch -D "1970-01-01 00:00" {} \;
'-D' unbekannte Option, aber touch -d ... macht es! Super!
2) Wie erstelle ich am einfachsten eine Liste mit den Hashes _aller_ Files?
Ungetestet: find /path/to/root -type f -exec md5sum {} \;
Die Zeile in ein Scripterl 'hashlist' gepackt und dann ./hashlist > /hier/her/hashlist.txt macht genau, was ich suchte! Prima!!! Schoenes Wochenende. MfG Th. Moritz -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Moin, Am Freitag, 8. April 2011, 17:22:08 schrieb Thomas Moritz:
Am Freitag, 8. April 2011 11:53:56 schrieb Bernhard Walle: [...]
Ungetestet: TZ=GMT find /path/to/root -type f -exec touch -D "1970-01-01 00:00" {} \;
Kleine Ergänzung: Die -exec-Option ist nicht sehr ressourcenschonend, da für jede Datei ein neuer Prozess geforkt wird. Außerdem könnte es Probleme bei Dateien mit Leer- oder Sonderzeichen im Namen geben (bin mir da aber nicht sicher). Besser: TZ=GMT find /path/to/root -type f -print0 | xargs -0 touch -d "1970-01-01 00:00" [...]
Ungetestet: find /path/to/root -type f -exec md5sum {} \;
Auch hier: find /path/to/root -type f -print0 | xargs -0 md5sum Jan -- Homepage: http://www.jan-trippler.de -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Hallo alter Scriptschmiedkollege, Am Fri, 08 Apr 2011, Jan Trippler schrieb:
Am Freitag, 8. April 2011, 17:22:08 schrieb Thomas Moritz:
Am Freitag, 8. April 2011 11:53:56 schrieb Bernhard Walle: [...]
Ungetestet: TZ=GMT find /path/to/root -type f -exec touch -D "1970-01-01 00:00" {} \;
Kleine Ergänzung: Die -exec-Option ist nicht sehr ressourcenschonend, da für jede Datei ein neuer Prozess geforkt wird. Außerdem könnte es Probleme bei Dateien mit Leer- oder Sonderzeichen im Namen geben (bin mir da aber nicht sicher).
'find ... -exec .. {} +' (und auch die Version mit ';') ist "sicher" ggü. Leer- und anderer Sonderzeichen. find übergibt die Dateinamen direkt beim 'exec' in char * argv[]. $ strace -f -eexecve -s 128 find . -type f -exec /bin/ls {} + execve("/usr/bin/find", ["find", ".", "-type", "f", "-exec", "/bin/ls", "{}", "+"], [/* 130 vars */]) = 0 Process 24398 attached Process 24397 suspended [pid 24398] execve("/bin/ls", ["/bin/ls", "./a b", "./a\nb", "./b", "./a"], [/* 130 vars */]) = 0 ./a ./a?b ./a b ./b Process 24397 resumed Process 24398 detached --- SIGCHLD (Child exited) @ 0 (0) --- HTH, -dnh -- God must love the Common Man; He made so many of them. -- BSD fortune file -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Am Freitag, 8. April 2011 17:11:43 schrieb David Haller: Hallo,
Am Fri, 08 Apr 2011, Bernhard Walle schrieb:
* Thomas Moritz
[2011-04-08 11:51]: Hallo, waehrend der Kernel baut, habe ich noch 2 Fragen.
1) Wie setze ich am einfachsten _alle_ Files des System auf 1.1.1970 00:00
Ungetestet: TZ=GMT find /path/to/root -type f -exec touch -D "1970-01-01 00:00" {} \;
TZ=UTC find /path/ -type f -exec touch -D "1970-01-01 00:00" {} +
So konnte ich fast alles setzen, nur keine Symlinks: TZ=GMT find /path -exec touch -d "1970-01-01 00:00" {} \; Auch hier klemmt es, die Symlinks haben die alte Zeit: TZ=GMT find /path -type l -exec touch -d "1970-01-01 00:00" {} \; Die Links werden alle von find gelistet. Hier scheint touch nicht ranzuwollen? Gibt es da noch einen Trick? MfG Th. Moritz -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Am Samstag, 9. April 2011 15:30:12 schrieb Thomas Moritz:
Am Freitag, 8. April 2011 17:11:43 schrieb David Haller:
Hallo,
So konnte ich fast alles setzen, nur keine Symlinks: TZ=GMT find /path -exec touch -d "1970-01-01 00:00" {} \;
Auch hier klemmt es, die Symlinks haben die alte Zeit: TZ=GMT find /path -type l -exec touch -d "1970-01-01 00:00" {} \;
Die Links werden alle von find gelistet. Hier scheint touch nicht ranzuwollen? Gibt es da noch einen Trick?
Scheinbar nein :-( There may be no way to change the timestamps of a symbolic link with a compiled C program. :-) The operating system kernel supplies an interface to change the ownership of a symbolic link with lchown(2) but does not supply any interface to change the timestamp of a symbolic link (no lutime(2) or lutimes(2) exists) and therefore what you are asking for is not supported by the operating system kernel. The only way I know to do this on BSD like systems is to remove and recreate the symlink. MfG Th. Moritz -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
* Thomas Moritz
Scheinbar nein :-(
There may be no way to change the timestamps of a symbolic link with a compiled C program. :-)
The operating system kernel supplies an interface to change the ownership of a symbolic link with lchown(2) but does not supply any interface to change the timestamp of a symbolic link (no lutime(2) or lutimes(2) exists) and therefore what you are asking for is not supported by the operating system kernel. The only way I know to do this on BSD like systems is to remove and recreate the symlink.
Linux ist aber nicht BSD. Die lutimes()-Funktion gibt es seit glibc 2.6 und Kernel 2.6.22 und touch scheint es mit der Option -h auch zu können. Wie immer ungetestet. Gruß, Bernhard -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Am Samstag, 9. April 2011 16:44:12 schrieb Bernhard Walle:
* Thomas Moritz
[2011-04-09 16:32]: Scheinbar nein :-(
There may be no way to change the timestamps of a symbolic link with a compiled C program. :-)
The operating system kernel supplies an interface to change the ownership of a symbolic link with lchown(2) but does not supply any interface to change the timestamp of a symbolic link (no lutime(2) or lutimes(2) exists) and therefore what you are asking for is not supported by the operating system kernel. The only way I know to do this on BSD like systems is to remove and recreate the symlink.
Linux ist aber nicht BSD. Die lutimes()-Funktion gibt es seit glibc 2.6 und Kernel 2.6.22 und touch scheint es mit der Option -h auch zu können. Wie immer ungetestet.
touch: Ungültige Option -- h „touch --help“ gibt weitere Informationen. 2.6.34.7-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 x86_64 x86_64 x86_64 GNU/Linux Ich teste nachher mal mit Kernel-2.6.38.2. Da kann ich aber gerade nicht ran. MfG Th. Moritz -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
* Thomas Moritz
touch: Ungültige Option -- h „touch --help“ gibt weitere Informationen.
Der neue Kernel wird da nichts helfen, du brauchst ein neues "touch". Das touch von Ubuntu 11.04 (beta) aus den GNU coreutils 8.5 hat es. Oder Du schreibst Dir selber ein kleines C-Programm. Gruß, Bernhard -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Moin, On Sat, 09 Apr 2011, 17:30:49 +0200, Thomas Moritz wrote:
Am Samstag, 9. April 2011 16:44:12 schrieb Bernhard Walle:
* Thomas Moritz
[2011-04-09 16:32]: Scheinbar nein :-(
There may be no way to change the timestamps of a symbolic link with a compiled C program. :-)
The operating system kernel supplies an interface to change the ownership of a symbolic link with lchown(2) but does not supply any interface to change the timestamp of a symbolic link (no lutime(2) or lutimes(2) exists) and therefore what you are asking for is not supported by the operating system kernel. The only way I know to do this on BSD like systems is to remove and recreate the symlink.
Linux ist aber nicht BSD. Die lutimes()-Funktion gibt es seit glibc 2.6 und Kernel 2.6.22 und touch scheint es mit der Option -h auch zu können. Wie immer ungetestet.
touch: Ungültige Option -- h „touch --help“ gibt weitere Informationen.
2.6.34.7-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 x86_64 x86_64 x86_64 GNU/Linux
Ich teste nachher mal mit Kernel-2.6.38.2. Da kann ich aber gerade nicht ran.
Hat nichts mit dem Kernel zu tun. Das wurde mit coreutils-8.1 (immerhin schon am 18 Nov 2009) eingefuehrt: ** New features ... touch now accepts the option --no-dereference (-h), as a means to change symlink timestamps on platforms with enough support. Mit Erschrecken habe ich gerade festgestellt, dass auf einem SLE{D,S} 11 SP1 nur coreutils-6.12 vorhanden ist...
MfG Th. Moritz
HTH, cheers. l8er manfred -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
* Manfred Hollstein
Mit Erschrecken habe ich gerade festgestellt, dass auf einem SLE{D,S} 11 SP1 nur coreutils-6.12 vorhanden ist...
Warum sollte man die coreutils auch bei einem Service Pack updaten? Gruß, Bernhard -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
On Sat, 09 Apr 2011, 17:47:58 +0200, Bernhard Walle wrote:
* Manfred Hollstein
[2011-04-09 17:41]: Mit Erschrecken habe ich gerade festgestellt, dass auf einem SLE{D,S} 11 SP1 nur coreutils-6.12 vorhanden ist...
Warum sollte man die coreutils auch bei einem Service Pack updaten?
wenn ich mich richtig erinnere, dann ist SLE 11 GA schon nach dem Releasedatum von coreutils-8.1 'rausgekommen, dann waere da ja genug Gelegenheit gewesen... Aber, neue Features sollten/sind ja auch bei einem SP moeglich - hat aber wohl ein entsprechener Feature Request mit Business Case gefehlt...
Gruß, Bernhard
Cheers. l8er manfred -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
Am Samstag, 9. April 2011 17:36:30 schrieb Bernhard Walle: Hallo Bernhard,
* Thomas Moritz
[2011-04-09 17:30]: touch: Ungültige Option -- h „touch --help“ gibt weitere Informationen.
Der neue Kernel wird da nichts helfen, du brauchst ein neues "touch". Das touch von Ubuntu 11.04 (beta) aus den GNU coreutils 8.5 hat es. Oder Du schreibst Dir selber ein kleines C-Programm.
Alles ist gut :-) Vielen Dank!!! Ich habe mir touch aus coreutils-8.9-4.1.x86_64.rpm rausgeklaut und gleich aus /home/.../bin/touch laufen lassen. Jetzt stimmt auch die Optik :-) MfG Th. Moritz -- To unsubscribe, e-mail: opensuse-programming-de+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming-de+help@opensuse.org
participants (5)
-
Bernhard Walle
-
David Haller
-
Jan Trippler
-
Manfred Hollstein
-
Thomas Moritz