Answer the question
In order to leave comments, you need to log in
How to make a backup on a server with linux?
It is necessary to make sure that the server makes a backup copy of the folder every week. The server is running Ubuntu 14.04. I know that you can use Cron for this - but I don’t know how to set up backup. Please tell me what needs to be done for this?
Answer the question
In order to leave comments, you need to log in
you need to create a bash script like this
#!/bin/bash
path='путь к папке'
archivepath='путь к архиву'
date=$(date +%y%m%d)
cd $path
tar -cf $archivepath/backup$date.tar *
@weekly путь к скрипту
Where do you want to backup your folder?
If you save on the local machine, but on a different partition/drive, then:
tar -cf /save_location/backup.tar /full_path/to_your_folder;
gzip -9 /save_location/backup.tar
add this to the script and set the cron to run once a week.
If you are going to backup to another machine over the network, then read about rsync there, the utility will be more fun
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question