Portál AbcLinuxu, 27. října 2025 22:47
find /prohledavany/adresar -type f -size -61c -print0 | xargs -0 rm
run-parts: /etc/cron.hourly/skriptik exited with return code 123
Copak to znamena?
EXIT STATUS
find exits with status 0 if all files are processed successfully, greater than 0 if errors occur. This is deliberately a very broad description, but if the
return value is non-zero, you should not rely on the correctness of the results of find.
Někde je nejspíš chyba...
#!/usr/bin/env bash
#nastavi prava
chown -R karel:users /home/karel/Záznamy &&
find /home/karel/Záznamy -type f -exec chmod 600 {} \; 2>/dev/null &&
find /home/karel/Záznamy -type d -exec chmod 700 {} \; 2>/dev/null &&
#smaze mensi nez 61 bytu
find /home/karel/Záznamy -type f -size -61c -print0 | xargs -0 rm 2>/dev/null
PS: prava menim proto, ze mi chodi root:root rw- r-- r--
find /home/karel/Záznamy -type f -size -61c -print0 | xargs -0 rm -f
Viz: rm --help
-f, --force ignore nonexistent files, never prompt
find ./ -maxdepth 1 -size -60k -type f -exec rm {}
Nejsem si jistý jestli to funguje přesně jak má, doporučuju to nejdřív otestovat. Všechno potřebné je v man find.
-exec rm {}-delete?
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.