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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:59:57+00:00 2026-06-15T20:59:57+00:00

This is a follow up to an earlier question about a terminal script for

  • 0

This is a follow up to an earlier question about a terminal script for Minecraft that will start up a server with 1 gigabyte of ram, and promptly begin a 30 minute loop that will make frequent backups of the server map.

This is the code I’m currently working with:

cd /Users/userme/Desktop/Minecraft
java -Xmx1024M -Xms1024M -jar minecraft_server.jar & bash -c 'while [ 0 ]; do cp -r /Users/userme/Desktop/Minecraft/world /Users/userme/Desktop/A ;sleep 1800;done' 

Now obviously, this loop will save the backups in directory “A” with the name “world”. Is there a modification I can make to this code so that it basically counts the amount of loops the script makes, and then applies that count to the end of the backups. For example, world5, or world 12. A modification that can get rid of old backups would be nice as well.

  • 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-15T20:59:58+00:00Added an answer on June 15, 2026 at 8:59 pm

    I broke it down into separate lines for better readability:

    If you want to put it back all into one line, you can add the ; back in where appropriate

    counter=1
    while [ 0 ] 
    do 
        if [ -e /Users/userme/Desktop/A/world"$counter" ]; then
            rm -f /Users/userme/Desktop/A/world"$counter"
        fi
        counter=$((counter+1))
        cp -r /Users/userme/Desktop/Minecraft/world /Users/userme/Desktop/A/world"$counter" 
        sleep 1800
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow-up to my earlier question I have written a script which
This is a follow-on question to my earlier question about specifying multiple schemata in
This is a follow on from an earlier question about how to condense a
This question is a follow up to an earlier question I had that was
This is a follow-up to an earlier question I posted on EF4 entity keys
This is a follow-up question to this question I asked earlier. Btw thanks Neil
this is a follow-up question to my question earlier this day . I have
This is a follow up to a question I asked earlier seen here: Confused
This is a follow-up to another question I asked earlier today. I am creating
This is a follow up to my earlier question . Tomcat 5.0.28 had a

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.