• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Script to update 'created on' timestamp"

Collapse

  • stek
    replied
    Originally posted by Pondlife View Post
    http://www.sentex.net/~mwandel/jhead/usage.html

    Will have a look at the weekend hopefully
    I'll have a crack at weekend too - Unix flavours despite being fairly consistent often isn't on stuff like this, once spent ages cursing RHEL cos it didn't have 'grep -p' like in AIX. Plus I just bagged a HP-UX box I wanna play with!

    Leave a comment:


  • Pondlife
    replied
    Originally posted by TheFaQQer View Post
    I found that, but couldn't get it to work on my Linux box (which is very out of date now), so didn't post it.

    The next step for you to consider is to go through the renamed files and take the new modified date and use that to correct the EXIF data in the image file

    http://www.sentex.net/~mwandel/jhead/usage.html

    Will have a look at the weekend hopefully

    Leave a comment:


  • TheFaQQer
    replied
    Originally posted by Pondlife View Post
    In case anyone else is ever looking for something similar, I've pinched this off askubuntu and it works fine on my MBP. Just add in the number of days you want to shift the timestamp by (73days in the case below).
    I found that, but couldn't get it to work on my Linux box (which is very out of date now), so didn't post it.

    The next step for you to consider is to go through the renamed files and take the new modified date and use that to correct the EXIF data in the image file

    Leave a comment:


  • Pondlife
    replied
    In case anyone else is ever looking for something similar, I've pinched this off askubuntu and it works fine on my MBP. Just add in the number of days you want to shift the timestamp by (73days in the case below).

    Note: this only updates the 'modified on' if it's later than 'created on' but I'll fiddle when I get the chance.

    Ta all.



    #!/bin/bash

    # find specific files
    files=$(find . -type f -name '*.jpg')

    # use newline as file separator (handle spaces in filenames)
    IFS=$'\n'

    for f in ${files}
    do
    # read file modification date using stat as seconds
    # adjust date using date and print in correct format
    # change file time using touch
    touch -t $(date -v +73d -r $(stat -f %m "${f}") +%Y%m%d%H%M.%S) "${f}"
    done

    Leave a comment:


  • Pondlife
    replied
    Originally posted by stek View Post
    If a Unix system (or Unix-like) 'touch -t timestamp_you_want filename(s) - wildcards/regex works in the filename bit.

    eg: touch -t 201409161030 pic*.jpg

    for a timestamp of 16th of Sept 2014 at 10:30am......

    EDIT: reread - this won't do exactly what you want, you'd need to do some awk/sed/grep'ing on a listing to squirt into a for loop.

    Cheers Stek.

    Leave a comment:


  • stek
    replied
    Originally posted by Pondlife View Post
    Maybe a long shot but thought I'd ask.

    Background: Every year when we go on hols I forget to update the current date/time on the camera, which means that all the image files have a created on of 01 Jan 2010 + the holiday duration.

    I'd like a script/prog/app that I can run in a directory that will update the created on timestamp relative to a specified value. i.e it replaces 01/01/2010 + holiday elapsed time with 16/09/2014 + HET

    Any ideas?

    TIA

    Pondy.
    If a Unix system (or Unix-like) 'touch -t timestamp_you_want filename(s) - wildcards/regex works in the filename bit.

    eg: touch -t 201409161030 pic*.jpg

    for a timestamp of 16th of Sept 2014 at 10:30am......

    EDIT: reread - this won't do exactly what you want, you'd need to do some awk/sed/grep'ing on a listing to squirt into a for loop.
    Last edited by stek; 16 September 2014, 10:56.

    Leave a comment:


  • Pondlife
    replied
    Originally posted by eek View Post
    What operating system?
    Mac, Win or Ubuntu.

    Originally posted by TheFaQQer View Post
    Don't know whether this still works, but it looks like it might do the trick - BulkFileChanger: Change date/time/attributes of multiple files
    Cheers Faq. Will take look.

    Leave a comment:


  • TheFaQQer
    replied
    Don't know whether this still works, but it looks like it might do the trick - BulkFileChanger: Change date/time/attributes of multiple files

    Leave a comment:


  • BrilloPad
    replied
    Originally posted by eek View Post
    What operating system?
    Don't say windows. NF will have a heart atack.

    Leave a comment:


  • eek
    replied
    Originally posted by Pondlife View Post
    Maybe a long shot but thought I'd ask.

    Background: Every year when we go on hols I forget to update the current date/time on the camera, which means that all the image files have a created on of 01 Jan 2010 + the holiday duration.

    I'd like a script/prog/app that I can run in a directory that will update the created on timestamp relative to a specified value. i.e it replaces 01/01/2010 + holiday elapsed time with 16/09/2014 + HET

    Any ideas?

    TIA

    Pondy.
    What operating system?

    Leave a comment:


  • Pondlife
    started a topic Script to update 'created on' timestamp

    Script to update 'created on' timestamp

    Maybe a long shot but thought I'd ask.

    Background: Every year when we go on hols I forget to update the current date/time on the camera, which means that all the image files have a created on of 01 Jan 2010 + the holiday duration.

    I'd like a script/prog/app that I can run in a directory that will update the created on timestamp relative to a specified value. i.e it replaces 01/01/2010 + holiday elapsed time with 16/09/2014 + HET

    Any ideas?

    TIA

    Pondy.
Working...
X