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 7794183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:42:32+00:00 2026-06-01T22:42:32+00:00

I want to run an image backup (using command line on windows) once a

  • 0

I want to run an image backup (using command line on windows) once a day. I want to keep one image for each of the last three days, so I have to rotate between 3 paths on each backup run, e.g.

c:\image0.ext // encode as 0, see text below
c:\image1.ext // encode as 1
c:\image2.ext // encode as 2

I though about writing 0, 1 or 2 in a text file, reading it’s value somehow, then do sth. like (number+1) mod 2, execute backup, write the new number to the text file. I would then link each number from 0 to 2 to a path using an if statement. Are there better/easier ways for that? Thanks for any hint!

  • 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-01T22:42:33+00:00Added an answer on June 1, 2026 at 10:42 pm

    Since imageX.ext is a file, I assume it is some compressed archive of your data analagous to a zip file. The modified date should get updated each time it is replaced with a new version, so you should not need a separate file to keep track of what is your most recent image. You can use DIR sorted by date to get the most recent image (last one listed).

    @echo off
    for /f "delims=" %%F in ('dir /b /od c:\image?.ext') do set lastImage=%%F
    set /a nextImage=(%lastimage:~-5,1%+1)%%3
    set nextImage="c:\image%nextImage%.ext"
    

    This algorithm will break if someone creates another file that matches your file mask after your last image was taken.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to to run several shaders one after the other (mostly image processing),
I want to run some JS code when an image's CSS property display has
I want to run a web application on php and mysql, using the CakePHP
I want to run a command as soon as a certain text appears in
I have a Sinatra::Base webservice which I want to start from a command line
I have a page where I want to run a long image along the
I am developing image aquisition software. I want to run display function in a
I want run a script as follows: runner: ssh 'java program &' ssh 'java
Why this code don't work,when i want run this code vwd 2008 express show
I want to run a light java app on a remote server running linux.

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.