TinkersDocs Home
Back to tektinkers.com
Setup Backup for Minecraft Java Ubunutu 22
For use when Minecraft is being run on Ubuntu Server 22 and backed up to another Ubuntu Server that is being used for file sharing.
sudo apt-get install openssh-client
OpenSSH has scp integrated to utilize
sudo apt-get install cron
Cron is used for scheduling backups
crontab -e
opens cron to enter scheduled backup
add line below for automated backup
0 0 * * * scp -r /path/to/files/* user@nas:/shared_folder/$(date +\%Y-\%m-\%d_\%H-\%M-\%S)/
“00***” sets the frequency to run
“scp -r” runs the utility scp while -r reads all files and files within directories.
“/path/to/files/* user@nas:/shared/folder/path/” is what files and directories to copy and where to paste them via ssh
“$(date +\%Y-\%m-\%d_\%H-\%M-\%S)/” puts all files being backed up into a folder named by date/time created.
crontab -l
verify's the scheduled backup
Since Cron simply runs the command line, you can run it yourself in the terminal as well.
crontab -l | grep scp | bash
————————————————————