I've been asked how to do some of this, and I wanted a place to just document it, I hope its ok if I use your forums. This is mostly to share with other admins, not to provide tech support for beginners in Linux. Feel free to use any of this, or simply get ideas.
This is just a document showing what I did, not intended as a howto where you don't change anything! I name the files "nom" after the community name, and we all have our preferences on naming directories, so you should go over each line and adjust it how you want it. I am not a programmer, so I hope someone just rewrites this better, at least the cartographer map making parts, and shares it.
My scripts do hourly backups, as well as make a daily cartographer map, and make "difference" maps where it marks up what has changed in red. This is useful for finding griefer damage, or even to see what interesting things other people have made. And lastly I have a script to make a slideshow video, here is an example
I have a user called "minecraft" that has all the minecraft files.
I will explain the directory layout, so you can adjust the paths in the scripts to your liking.
minecraft - the minecraft program itself
minecraft/WorldNomNomNom - that is my world directory
bin - where I put scripts and things
backups - where the backups are
web-maps - a web accessable directory, so my users can actually see the work. This happens to be http://gamedownloads.nom-nom-nom.us/minecraft/maps for my server.
Required programs:
ImageMagick - I'm using CentOS and the version that comes with the OS was too old. If you get an error about no such option to "convert" or "compare", then you'll need to upgrade. I had to get the RPM right off the main imagemagick.org website, the install was pretty painless, just remove ImageMagick package, and rpm install it.
Cartographer - viewtopic.php?f=25&t=13134
Get the Linux version obviously. If you get compile errors, make sure to install zlib-devel and libpng-devel
All the scripts will look for ~/bin/cart5 for cartographer.
7zip - http://www.7-zip.org/ If you aren't using 7zip instead of RAR or ZIP, you're missing out.
The linux port is called p7zip (yum install p7zip or apt-get install p7zip).
crontab:
# do a backup every hour
0 * * * * nice -n 20 ~/bin/backup-minecraft.sh
# 5:05 make cartographer maps
5 5 * * * nice -n 20 ~/bin/makemaps.sh
Backups:
Here is ~/bin/backup-minecraft.sh
#! /bin/bash
THEDATE=`date +%Y%m%d-%H%M`
cd
7z a ~/backups/game/minecraft.$THEDATE.7z minecraft -x@${HOME}/bin/exclude-world.txt
7z a ~/backups/world/minecraft.$THEDATE.7z minecraft/WorldNomNomNom
# remove old backups, anything over a day old
find ~/backups -type f -mtime +1 -exec rm -f '{}' \;
-x is "exclude" in 7zip, this way I can tell it to not backup the world data. The first 7z backs up just the game directory, and the 2nd one backs up the world.
The file bin/exclude-world.txt just contains the one line:
minecraft/WorldNomNomNom
Which is the path to my world.
Most people probably won't care to organize it that tightly, but I provide download links to my world backups, and I didn't want people downloading all my configs.
Cartographer:
For this to work, cartographer will look in ~/.minecraft/saves/World1 (for the first world, for example), so you'll want to trick that into looking in your world directory, whereever it is. On my server I did this:
Here is the contents of ~/bin/makemaps.sh
This script will look in the current copy of minecraft's world directory and make the map.
#! /bin/bash
export RTMP=/tmp/makemaps.$$.
# make catographer maps
cd ~/web-maps
THEFILE=nomland-`date +%Y%m%d-%H%M`.png
( echo 1 ; echo WOb ) | ~/bin/cart5
# remove the .txt file that it makes
rm -f map1.txt
# this sleep makes it easier to hit control-c in case I made a mistake
sleep 1
convert -quality 100 -rotate 90 map1-*.png $THEFILE \
&& rm -f map1-*.png
rm -f current.png
ln $THEFILE current.png
# also make the diff maps
~/bin/makechanges.sh
Here is ~/bin/makechanges.sh
I made it its own script in case I want to just regnerate a difference map without creating a whole map.
#! /bin/bash
export RTMP=/tmp/makechanges.$$.
cd ~/web-maps
OLD=`ls nom*.png | tail -2 | head -1`
NEW=`ls nom*.png | tail -1`
echo old $OLD
echo new $NEW
compare -lowlight-color white $OLD $NEW $RTMP.1.tga
convert -transparent white $RTMP.1.tga $RTMP.2.tga
composite -quality 100 $RTMP.2.tga $OLD changes/changes-$NEW
rm -f new.png
ln changes/changes-$NEW new.png
rm -rf $RTMP.*
Slideshow
This is totally as a bonus, its how I made the youtube vid. I only did it because it was fun, its not that useful.
I made a directory called "out" to do all the processing (don't ask why I named it that). So I end up with ~/out/minecraft/minecraft/WorldNomNomNom as my world directory. Kind of lame, but that's how I did it. I did this on a separate server from my main minecraft server.
Some preprocessing to set things up
mkdir -p ~/out/minecraft ~/out/minecraft/slides
cd ~/out/minecraft
ln -s ~/.minecraft/saves/World2 minecraft/WorldNomNomNom
Here is makehourlyslides.sh, you are not supposed to cron this, this will unzip each backup one at a time into another directory, run cartographer on it, and do all the processing.
Note is is using world 2, so there's a "2" after the input to cartographer.
#! /bin/bash
# comment out this next line if you want to just manually edit slidelist.txt
# and make it contain exactly which backups you want to generate
ls ~/backups/world > /tmp/slidelist.txt
for i in `/tmp/slidelist.txt`
do
# rm -rf is a very scary command, make damn sure you're in the right directory. You should be in ~/out/
rm -rf minecraft
7z x ~/backups/world/$i
( echo 2 ; echo WOb ) | ~/bin/cart5
convert -quality 100 -rotate 90 map?-*.png slides/$i.png \
&& rm -f map?-*.png
done
At that point you should have nice hourly cartographer maps.
You can run file on the png files to get the dimensions:
Note the sizes, the more different they are, the more screwed you are. If your users like to randomly explore off the borders, it will hurt your ability to make the slideshow. If they just nudge it a little bit, like the above shows a 16 pixels widening, your slideshow will just shift over a tiny bit, no big deal.
Now you have to figure out what part of the map you want to show in the slideshow. If your world has been running awhile, chances are its pretty huge. On my world, the cropped area was 858x917 in size, and the cropping started at 1049 across and 2230 down. In ImageMagick terms, it is expressed as 858x917+1049+2230
Ok, now that you have the slides, lets make cropped versions, then compare maps of those, and insert a text overlay at the bottom showing the part of the filename that has the date/time. It runs md5sum to omit any slides where nothing changed, who wants to sit through slides that don't change? Not me!
I called this makediffs.sh
#! /bin/bash
# this script assumes slides is filled with all the same dimensions
# manually peel out any really odd size ranges
cd ~/out/minecraft/slides
mkdir zoomed zoomed-text
#echo make a list of only the unique images
md5sum -b *.png | uniq -w 32 | awk -F'*' '{print $2}' > /tmp/list1
echo make cropped versions with and without text overlay
for i in `cat /tmp/list1`
do echo $i
NICENAME=`echo $i | awk -F. '{print $2}'`
convert $i -crop 858x917+1049+2230 -quality 100 ../zoomed/$i
convert ../zoomed/$i -quality 100 -pointsize 24 label:$NICENAME -gravity Center -append ../zoomed-text/$i
done
echo make compare versions
cd ~/out/minecraft/zoomed
# remove the | bash at the end if you want to debug what its doing
ls | awk -f ~/bin/diffy.awk | bash
rm -f /tmp/temp1.tga /tmp/temp2.tga /tmp/temp3.tga
# cleanup temp file
rm -f /tmp/list1
Here is diffy.awk, which is used in the above script.
BEGIN { getline
LAST = $0 }
{ split($0,x,".")
NICENAME = x[2]
print "compare -lowlight-color white " LAST " " $0 " /tmp/temp1.tga"
print "convert -transparent white /tmp/temp1.tga /tmp/temp2.tga"
print "composite -quality 100 /tmp/temp2.tga " LAST " /tmp/temp3.tga"
print "convert /tmp/temp3.tga -quality 100 -pointsize 24 label:\"" NICENAME "\" -gravity Center -append ../changes/changes-" $0
LAST = $0
}
Now the "changes" directory will be filled with the slides, there may be tools in linux to make a movie out of it, but I didn't feel like it, I just used windows movie maker.
Nope, but corona was a pretty easy install, ./configure ; make ; make install and it all worked for me. What problems to people have?
I was getting the memcpy errors until I added in the include for cstring to Convert and OpenTGA. Then it appeared to work, I did a make clean then make && sudo make install. I was able to get Cart to compile but when I run cart5 I'm getting the following error:
./cart5: error while loading shared libraries: libcorona-1.0.2.so: cannot open shared object file: No such file or directory
libcorona-1.0.2.so is currently residing at /usr/local/lib/. I'm running Ubuntu 10.04 at the moment if that helps at all
Oh geez, well to be fair, when you make install, it does tell you to ldconfig, you need to do that after installing any .so file. Glad to hear that worked out.
I guess one of us could make RPMs for people, but then you'd have to get an RPM for libcorona, and it wasn't in any repository I use. For a silly fun thing, may as well just compile.
It may be antique or whatever, but when you install it, it tells you to run ldconfig.
I guess the only improvement is if it ran ldconfig for you, then users who refuse to read instructions will be able to use it.
Good catch, I do them hourly on my server but forgot to update the comment. Fixed the original post, though I should probably just delete this whole thing, the only responses are about Cartographer, or people error checking it, if nobody learned anything from this, or wants to respond by sharing their own ideas on things they've done with their own servers to add features or do things more efficiently, then this is a waste of everyone's time.
Good catch, I do them hourly on my server but forgot to update the comment. Fixed the original post, though I should probably just delete this whole thing, the only responses are about Cartographer, or people error checking it, if nobody learned anything from this, or wants to respond by sharing their own ideas on things they've done with their own servers to add features or do things more efficiently, then this is a waste of everyone's time.
I wouldn't delete this thread. It's pretty damn useful if you ask me. There is a serious lack of good linux support on this forum and this thread represents good support. Thanks for posting your scripts dude. They helped me with mine :smile.gif:
Very excellent reference scripts, but can you clarify what this line does and for what purpose?
7z a ~/backups/game/minecraft.$THEDATE.7z minecraft -x@${HOME}/bin/exclude-world.txt
Oh good question, yeah I didn't explain that at all.
7z being the linux port of 7-zip, the package is really called p7zip.
-x is "exclude", so I have that exclude-world.txt file that just lists what I want to exclude, and it contains the single line:
minecraft/WorldNomNomNom
The reason for this is to separate the backup files, so I can zip up my minecraft server directory without the world. Then the 2nd 7z line backs up the world directory by itself.
The reason I do that is because I provide download links publicly of my world, and I didn't want to have people downloading all my configs and stuff.
Truthfully, I don't do it the above way anymore, I've since moved my game directory to /tmp (which on my system is a tmpfs mount) so its basically in a RAMdisk. Then I just back it up out of there and don't need to exclude anything.
You can try downloading the map to your computer and running MCEdit on it, and if theres any unncessary areas you can "destroy" them to save some room.
One thing I'd like to figure out is incremental backups, but I didn't put any time into researching a good tool. I'd love to just keep all the backups, but its just an outrageous size having hourly full backups. I think I have an idea, I'll do a full 7z, touch a file, then use find -newer filename, that will give me a list of whats changed, and I'm sure 7z can just backup from a list of files.
You can try downloading the map to your computer and running MCEdit on it, and if theres any unncessary areas you can "destroy" them to save some room.
One thing I'd like to figure out is incremental backups, but I didn't put any time into researching a good tool. I'd love to just keep all the backups, but its just an outrageous size having hourly full backups. I think I have an idea, I'll do a full 7z, touch a file, then use find -newer filename, that will give me a list of whats changed, and I'm sure 7z can just backup from a list of files.
Great idea! I use rdiff-backup at work. I'm in a weird position though since I need to keep it in an easy format (so I can provide public download links). It's a good idea though for most people though! Given that chunks are already gzip compressed, and rdiff would just evaluate each file, it just fits really well.
I made that differential backup script with 7zip, having a full backup and a backup of only files that were modified since the last full backup. I won't bother sanitising this, don't use this as-is obviously, its mostly to share the concept. Touching a file just before the full backup, then later doing a find -newer against that file to see whats changed. Then @filename.txt means use filename.txt as the list of files to back up.
#! /bin/bash
THEDATE=`date +%Y%m%d-%H%M`
RTMP=/tmp/minecraft-backuplist.$$
#cd ~
#7z a ~/backups/game/minecraft.$THEDATE.7z minecraft
cd /tmp
find WorldNomNomNom -type f -newer ~/minecraft/touchfile > $RTMP
7z a ~/backups/world/minecraft.$THEDATE-inc.7z @$RTMP
rm -f $RTMP
backup-minecraft-full.sh
#! /bin/bash
THEDATE=`date +%Y%m%d-%H%M`
cd ~
7z a ~/backups/game/minecraft.$THEDATE.7z minecraft
cd /tmp
touch ~/minecraft/touchfile
7z a ~/backups/world/minecraft.$THEDATE-full.7z WorldNomNomNom
# remove old backups
find ~/backups -type f -mtime +3 -exec rm -f '{}' \;
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
full screen of everything running makemaps.sh
Cartography rewritten for linux by Firemark [pozdrawiam halp]
select world:[1,2,3,4,5]
:Select flags:
W - water; C - cave mode
R - rotate; F - flip
D - day; d -day/night; N - night
Hc - heightcolor; Hg - heightgray; Or - Ore
Ob - oblique; Oa - oblique angle
E - exclude
:/home/djkelso/.minecraft/saves/World1 map1
1)Generate tree of files...
Done!
2)Unzip and draw...
Done!
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
./makemaps.sh: line 10: 29981 Done ( echo 1; echo WOb )
29982 Aborted | ~/bin/cart5
convert: unable to open image `map1-*.png': No such file or directory.
convert: unable to open file `map1-*.png'.
convert: missing an image filename `nomland-20100924-1822.png'.
ln: accessing `nomland-20100924-1822.png': No such file or directory
ls: nom*.png: No such file or directory
ls: nom*.png: No such file or directory
old
new
compare: unrecognized option `-lowlight-color'.
convert: unable to open image `/tmp/makechanges.30417..1.tga': No such file or directory.
convert: missing an image filename `/tmp/makechanges.30417..2.tga'.
composite: unable to open image `/tmp/makechanges.30417..2.tga': No such file or directory.
composite: missing an image filename `changes/changes-'.
ln: accessing `changes/changes-': No such file or directory
http://www.myminecraft.com Survival and creative servers
Teamspeak available, multiple anti-grief measures in place
VIP based whitelist to limit griefing even further.
But actually... there's a better cartograph for linux that supports real commandline switches like a normal CLI app, and uses libpng. The output is identical, I even did a byte comparison, it makes the same maps, just with less pain.
thanks for the reply, unfortunately, i get the same error. Im working on getting more ram for my poweredge 2850, just not cheap..
on a side note, would it be possible in bash to add another command switch? I tried, but am having problems capturing the output. I could probably do it in PHP, which i might go that route if im unsuccessful.
I want to do like ./minecraft.sh list
have it pop into screen
list
save output and then either dump that to a file, or i can make it update a db. Unless you know an easier way i can display whos on the server for my website.
Rollback Post to RevisionRollBack
http://www.myminecraft.com Survival and creative servers
Teamspeak available, multiple anti-grief measures in place
VIP based whitelist to limit griefing even further.
You're talking about interacting with an already running process. I've been trying to do that too!
I've had partial success trying to use stdin/stdout of the minecraft process, but its really unreliable, sometimes it works, but sometimes it just hangs. I think the best approach would be some kind of wrapper script that takes care of it, but I'm not a programmer.
Just to see if I could do it, I echo'd the commands to the stdin manually, then head stdout to capture the output.
First I had to start up minecraft in this bizzare way, to ensure stdin/stdout are pipes:
Then setting $MINEPROC to the java process id, I can do:
echo list > /proc/$MINEPROC/fd/0 ; head -1 /proc/$MINEPROC/fd/2
It works.. sometimes, but many times it just hangs. Maybe if I use something else than cat.
Maybe someone that knows a lot about pipes in linux can tell me how to accomplish this.
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
That's an old version of Cartograph trying to allocate 7GB of RAM. It's the older version that's compiled against the Corona library. This has since been fixed by switching to libpng, but not before I had already switched to MCMap (available here) and Minecraft Overviewer. Since I do both at once, I also thought I'd share the script that I use, with thanks to ratty for his original plan:
#!/bin/bash
NOW=`date +%Y%m%d-%H%M`
# Make the Google Maps
cd ~/google-mapper
echo Making Google maps in the background
screen -dmS google-map ~/google-mapper/genmap.sh
# Make the MCMaps
cd ~/public_html/images/
echo Now I will make the maps.
~/bin/mcmap -skylight -brightedge -noise 10 ~/world/ > ~/log/map.day.log
echo -n Raw day map done
convert output.bmp worldland-day-${NOW}.png
echo ..and converted to .PNG
rm output.bmp
echo Cleaned up raw map.
~/bin/mcmap -night -noise 10 ~/world/ > ~/log/map.night.log
echo -n Raw night map done
convert output.bmp worldland-night-${NOW}.png
echo ..and converted to .PNG
rm output.bmp
echo Cleaned up raw map.
~/bin/mcmap -cave -noise 10 ~/world/ > ~/log/map.caves.log
echo -n Raw underground map done
convert output.bmp worldcaves-${NOW}.png
echo ..and converted to .PNG
rm output.bmp
echo Cleaned up raw map.
rm -f worldland-day.png worldland-night.png worldcaves.png
echo Removed hardlinks to formerly latest maps.
ln worldland-day-${NOW}.png worldland-day.png
ln worldland-night-${NOW}.png worldland-night.png
ln worldcaves-${NOW}.png worldcaves.png
echo Created hardlinks to new latest maps.
echo Static maps are done. The Google map is probably still generating in its screen:
screen -ls | grep google
After the Google Map generator is done, it also calls a script that runs pngcrush on all the images, which helps to conserve hard drive space.
Also, because some folks build quickly, I take four snapshots daily:
$ crontab -l
# m h dom mon dow command
0 1,7,13,19 * * * /home/minecraft/bin/makemaps.sh
This is just a document showing what I did, not intended as a howto where you don't change anything! I name the files "nom" after the community name, and we all have our preferences on naming directories, so you should go over each line and adjust it how you want it. I am not a programmer, so I hope someone just rewrites this better, at least the cartographer map making parts, and shares it.
My scripts do hourly backups, as well as make a daily cartographer map, and make "difference" maps where it marks up what has changed in red. This is useful for finding griefer damage, or even to see what interesting things other people have made. And lastly I have a script to make a slideshow video, here is an example
(I recommend 1080p HD, and full screen it)
And here is the daily "difference" map.
http://gamedownloads.nom-nom-nom.us/min ... ps/new.png
Overview:
I have a user called "minecraft" that has all the minecraft files.
I will explain the directory layout, so you can adjust the paths in the scripts to your liking.
minecraft - the minecraft program itself
minecraft/WorldNomNomNom - that is my world directory
bin - where I put scripts and things
backups - where the backups are
web-maps - a web accessable directory, so my users can actually see the work. This happens to be http://gamedownloads.nom-nom-nom.us/minecraft/maps for my server.
Required programs:
ImageMagick - I'm using CentOS and the version that comes with the OS was too old. If you get an error about no such option to "convert" or "compare", then you'll need to upgrade. I had to get the RPM right off the main imagemagick.org website, the install was pretty painless, just remove ImageMagick package, and rpm install it.
Cartographer - viewtopic.php?f=25&t=13134
Get the Linux version obviously. If you get compile errors, make sure to install zlib-devel and libpng-devel
All the scripts will look for ~/bin/cart5 for cartographer.
7zip - http://www.7-zip.org/ If you aren't using 7zip instead of RAR or ZIP, you're missing out.
The linux port is called p7zip (yum install p7zip or apt-get install p7zip).
crontab:
Backups:
Here is ~/bin/backup-minecraft.sh
-x is "exclude" in 7zip, this way I can tell it to not backup the world data. The first 7z backs up just the game directory, and the 2nd one backs up the world.
The file bin/exclude-world.txt just contains the one line:
minecraft/WorldNomNomNom
Which is the path to my world.
Most people probably won't care to organize it that tightly, but I provide download links to my world backups, and I didn't want people downloading all my configs.
Cartographer:
For this to work, cartographer will look in ~/.minecraft/saves/World1 (for the first world, for example), so you'll want to trick that into looking in your world directory, whereever it is. On my server I did this:
Here is the contents of ~/bin/makemaps.sh
This script will look in the current copy of minecraft's world directory and make the map.
Here is ~/bin/makechanges.sh
I made it its own script in case I want to just regnerate a difference map without creating a whole map.
Slideshow
This is totally as a bonus, its how I made the youtube vid. I only did it because it was fun, its not that useful.
I made a directory called "out" to do all the processing (don't ask why I named it that). So I end up with ~/out/minecraft/minecraft/WorldNomNomNom as my world directory. Kind of lame, but that's how I did it. I did this on a separate server from my main minecraft server.
Some preprocessing to set things up
Here is makehourlyslides.sh, you are not supposed to cron this, this will unzip each backup one at a time into another directory, run cartographer on it, and do all the processing.
Note is is using world 2, so there's a "2" after the input to cartographer.
At that point you should have nice hourly cartographer maps.
You can run file on the png files to get the dimensions:
Note the sizes, the more different they are, the more screwed you are. If your users like to randomly explore off the borders, it will hurt your ability to make the slideshow. If they just nudge it a little bit, like the above shows a 16 pixels widening, your slideshow will just shift over a tiny bit, no big deal.
Now you have to figure out what part of the map you want to show in the slideshow. If your world has been running awhile, chances are its pretty huge. On my world, the cropped area was 858x917 in size, and the cropping started at 1049 across and 2230 down. In ImageMagick terms, it is expressed as 858x917+1049+2230
Ok, now that you have the slides, lets make cropped versions, then compare maps of those, and insert a text overlay at the bottom showing the part of the filename that has the date/time. It runs md5sum to omit any slides where nothing changed, who wants to sit through slides that don't change? Not me!
I called this makediffs.sh
Here is diffy.awk, which is used in the above script.
Now the "changes" directory will be filled with the slides, there may be tools in linux to make a movie out of it, but I didn't feel like it, I just used windows movie maker.
Static linking gcc c++ programs is harder than you might think, otherwise I'd offer to provide downloads for them.
http://www.trilithium.com/johan/2005/06/static-libstdc/
I was getting the memcpy errors until I added in the include for cstring to Convert and OpenTGA. Then it appeared to work, I did a make clean then make && sudo make install. I was able to get Cart to compile but when I run cart5 I'm getting the following error:
./cart5: error while loading shared libraries: libcorona-1.0.2.so: cannot open shared object file: No such file or directory
libcorona-1.0.2.so is currently residing at /usr/local/lib/. I'm running Ubuntu 10.04 at the moment if that helps at all
EDIT
I just needed to run the following:
I hope this helps someone out
I guess one of us could make RPMs for people, but then you'd have to get an RPM for libcorona, and it wasn't in any repository I use. For a silly fun thing, may as well just compile.
I guess the only improvement is if it ran ldconfig for you, then users who refuse to read instructions will be able to use it.
creates a backup every hour, every 0 minute of * hour, all hours. if you want midnight it should be
I wouldn't delete this thread. It's pretty damn useful if you ask me. There is a serious lack of good linux support on this forum and this thread represents good support. Thanks for posting your scripts dude. They helped me with mine :smile.gif:
Oh good question, yeah I didn't explain that at all.
7z being the linux port of 7-zip, the package is really called p7zip.
-x is "exclude", so I have that exclude-world.txt file that just lists what I want to exclude, and it contains the single line:
minecraft/WorldNomNomNom
The reason for this is to separate the backup files, so I can zip up my minecraft server directory without the world. Then the 2nd 7z line backs up the world directory by itself.
The reason I do that is because I provide download links publicly of my world, and I didn't want to have people downloading all my configs and stuff.
Truthfully, I don't do it the above way anymore, I've since moved my game directory to /tmp (which on my system is a tmpfs mount) so its basically in a RAMdisk. Then I just back it up out of there and don't need to exclude anything.
One thing I'd like to figure out is incremental backups, but I didn't put any time into researching a good tool. I'd love to just keep all the backups, but its just an outrageous size having hourly full backups. I think I have an idea, I'll do a full 7z, touch a file, then use find -newer filename, that will give me a list of whats changed, and I'm sure 7z can just backup from a list of files.
You might be interested in rdiff-backup.
I made that differential backup script with 7zip, having a full backup and a backup of only files that were modified since the last full backup. I won't bother sanitising this, don't use this as-is obviously, its mostly to share the concept. Touching a file just before the full backup, then later doing a find -newer against that file to see whats changed. Then @filename.txt means use filename.txt as the list of files to back up.
backup-minecraft-full.sh
full screen of everything running makemaps.sh
running centos 5.4
free shows
total used free shared buffers cached
Mem: 4147924 2808096 1339828 0 190336 1231592
-/+ buffers/cache: 1386168 2761756
Swap: 4096564 96 4096468
http://www.myminecraft.com Survival and creative servers
Teamspeak available, multiple anti-grief measures in place
VIP based whitelist to limit griefing even further.
( echo 1 ; echo WOb ) | ~/bin/cart5
Its probably running out of RAM or something.
But actually... there's a better cartograph for linux that supports real commandline switches like a normal CLI app, and uses libpng. The output is identical, I even did a byte comparison, it makes the same maps, just with less pain.
viewtopic.php?f=25&t=13134&start=1110#p623995
http://rghost.net/2629538
cartograph -w /path/to/your/world -O=whatever.png -R=oblique -l=day
on a side note, would it be possible in bash to add another command switch? I tried, but am having problems capturing the output. I could probably do it in PHP, which i might go that route if im unsuccessful.
I want to do like ./minecraft.sh list
have it pop into screen
list
save output and then either dump that to a file, or i can make it update a db. Unless you know an easier way i can display whos on the server for my website.
http://www.myminecraft.com Survival and creative servers
Teamspeak available, multiple anti-grief measures in place
VIP based whitelist to limit griefing even further.
I've had partial success trying to use stdin/stdout of the minecraft process, but its really unreliable, sometimes it works, but sometimes it just hangs. I think the best approach would be some kind of wrapper script that takes care of it, but I'm not a programmer.
Just to see if I could do it, I echo'd the commands to the stdin manually, then head stdout to capture the output.
First I had to start up minecraft in this bizzare way, to ensure stdin/stdout are pipes:
cat | java -Xms1024M -Xmx1024M -jar Minecraft_Mod.jar nogui 2>&1 | cat
Then setting $MINEPROC to the java process id, I can do:
echo list > /proc/$MINEPROC/fd/0 ; head -1 /proc/$MINEPROC/fd/2
It works.. sometimes, but many times it just hangs. Maybe if I use something else than cat.
Maybe someone that knows a lot about pipes in linux can tell me how to accomplish this.
That's an old version of Cartograph trying to allocate 7GB of RAM. It's the older version that's compiled against the Corona library. This has since been fixed by switching to libpng, but not before I had already switched to MCMap (available here) and Minecraft Overviewer. Since I do both at once, I also thought I'd share the script that I use, with thanks to ratty for his original plan:
After the Google Map generator is done, it also calls a script that runs pngcrush on all the images, which helps to conserve hard drive space.
Also, because some folks build quickly, I take four snapshots daily: