If you wished to have a script named /bin/backup-yeahhub.sh run every day at 1 PM, your crontab entry would look like as follows. You need to use crontab command for editing or setting up your own cron jobs.Ĭhoose any editor for editing the crontab configuration file (we choose No. Type the code you received from your Representative and click Continue to proceed. Support is an extra cost and required for the life of the product. ![]() Your business relies upon your accounting software for day-to-day operations and timely reporting. EZ Backup is categorized as System Utilities. Software support is one of the most important aspects of a successful implementation. The actual developer of the free program is Ravi Bhavnani. path/to/command – Script or command name to schedule Our software library provides a free download of EZ Backup 1.0. Each user can have their own crontab file, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly.ĥ: Day of the week(0-7 ) You need to use the crontab command for fully automation. To make it automated, you need to first move this script into /bin directory and give 755 permission to bash file as shown below: Here you can see that, a tar.gz archive file has been created with format () but this process is still not automated. Now give the executable permissions to above script with the help of chmod command as shown below:Īnd run the script by typing “. In above script, we’ve defined a BACKUP_DIR variable which contains your backup directory location and an automated removal command which will delete all old backups files which is older than 10 days, so that your HD space won’t be fillup quickly. Tar -zcvpf $BACKUP_DIR/yeahhub-$ /var/www/htmlįind $BACKUP_DIR/* -mtime +10 -exec rm \ # take each website’s backup in separate name, use below format # So to overcome this, we’ve created a simple bash script for taking backup in an organized format. If you want to take backup on daily basis, then you need to run the above command manually every day which is not a good idea though. z = This will tell tar that compress the files further to reduce the size of tar file.You can schedule a job to run on a set hourly, daily, weekly, or monthly basis. p = Preserving files and directory permissions. The backup jobs are scheduled to regularly update the data in the backup folder to a user-defined intervals.Which will create a archive file of whole /var/www/html/ directory and save it in /root/backup/ folder. To create a tar archive file, the simple command is:Ĭommand: tar -zcvpf /root/backup/backup-fresh.tar /var/www/html/ Your first step is to create a backup directory in any location where you want to place all backups in an organized manner. In our case, our Apache Server is running on Port 80 and /var/www/html is the default root folder of web server where we’ve installed one CMS under Drupal directory. In this article, we’re going to show you how to use tar for Backup Files and Directories in Linux along with automatic scheduling with cronjob. If you are using somehow a managed or unmanaged VPS server then this article will definitely helps you to create a backup of your webserver on schedule basis with the help of cronjob.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |