Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:58:05+00:00 2026-06-10T10:58:05+00:00

I’m finding it difficult to word my question in a way I can search

  • 0

I’m finding it difficult to word my question in a way I can search for the answer, my problem is as follows…..

I have a webcam that takes a photo every 2mins and saves as a numbered file, the first photo is taken at 0000hrs and is named image001.jpg, at 0002hrs image002.jpg and so on. At 2359hrs all the photos are turned in to 24hr time lapse video and saved as daily_video.mov. At 0000hrs (of the next day) the old image001.jpg is over written and the whole process repeated including generation of a new daily_video.mov.
This is all working fine with the webcam doing the file naming and overwriting, and a cron job running fffmpeg once a day to make the video.

What I want to do now is make a time lapse video over say a month by copying every 30th file from the days images to a new folder and naming in a sequential order. ie.
Day 1; image030.jpg, image060.jpg, etc… are renamed to Archive001.jpg, Archive002.jpg,etc…
But on day 2; image030.jpg, image060.jpg etc… Will need to be named to Archive025.jpg, Archive026.jpg etc.. and repeat untill the end of the month copying files from the day to a sequentially increasing in name list of files to use at the end of month, where the process can be repeated.

Does that make sense?!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:58:06+00:00Added an answer on June 10, 2026 at 10:58 am

    You could use a bash script like the following. Just call it at 2359hrs.
    Remeber to make it executable using chmod +x myScript
    I did not rename to Archive00X.jpg, but by adding the current date, they will be in proper alphabetical order.

    example output:

    cp files/image000.jpg >> archive/image_2012-08-29_000.jpg
    cp files/image030.jpg >> archive/image_2012-08-29_030.jpg
    ....
    
    • adapt pSource and pDest to your paths (preferrably absolute paths)
    • adapt offset and maxnum to your needs. If maxnum is too big it will tell you some files are missing, but otherwise work properly.
    • Remove the echo lines if they disturb you 😉

    Code:

    #!/bin/bash
    
    pSource="files"
    pDest="archive"
    
    offset=30
    maxnum=721
    
    curdate=`date "+%F"`
    
    function rename_stuff()
    {
     myvar=0
     while [ $myvar -lt $maxnum ]
     do
        forg=`printf image%03d.jpg ${myvar}`
        fnew=`printf image_%s_%03d.jpg ${curdate} ${myvar}`
    
        forg="$pSource/$forg"
        fnew="$pDest/$fnew"
    
        if [ -f "$forg" ]; then
         echo "cp $forg >> $fnew"
         cp "$forg" "$fnew"
        else
         echo "missing file $forg"
        fi
    
        myvar=$(( $myvar + $offset ))
    done
    }
    
    rename_stuff
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have an autohotkey script which looks up a word in a bilingual dictionary
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.