bash - Ux modify timestamp -
i'm trying write ux script change timestamp (add 10years). working on debian no idea how on solaris (-d , + 10 years not working)
find directory -print | while read filename; touch -d "$(date -r "$filename") + 10 years" "$filename" done
it adds ten years in terms of 10*365*24*3600
seconds,
find directory -print|perl -mfile::stat -lne 'utime((stat($_)->mtime +10*365*24*3600) x2, $_)'
in case file::stat
not available,
find directory -print|perl -lne 'utime(((stat($_))[9] +10*365*24*3600) x2, $_)'
Comments
Post a Comment