Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

backup public_html

#!/bin/bash
DATE=$(date +%d-%m-%Y)
BACKUP_DIR="/root/backup/web-backup"

# To create a new directory into backup directory location.
mkdir -p $BACKUP_DIR/$DATE

# take each website backup in separate name, use below format.
tar -zcvpf $BACKUP_DIR/2daygeek-$DATE.tar.gz /home/2daygeek
tar -zcvpf $BACKUP_DIR/mageshm-$DATE.tar.gz /home/mageshm
tar -zcvpf $BACKUP_DIR/dialariyalur-$DATE.tar.gz /home/dialariyalur
tar -zcvpf $BACKUP_DIR/ariyalurlive-$DATE.tar.gz /home/ariyalurlive

# Delete files older than 10 days
find $BACKUP_DIR/* -mtime +10 -exec rm {} ;
Comment

PREVIOUS NEXT
Code Example
Shell :: Bash script general template to generate script format 
Shell :: mac secure erase free space 
Shell :: D install script 
Shell :: metasploit reverse shell 
Shell :: ssh local 
Shell :: remove file kali shell 
Shell :: scan all venriabilty usign NMAP 
Shell :: embedded video doesnt play on gitjub pages 
Shell :: Save Resources in K8s, Delete Failed Pods 
Shell :: How to change first occurrence of word in a string 
Shell :: Bash Script To Clean 2+ Days Old Autobackup 
Shell :: cherry pick multiple commits 
Shell :: ss command in linux 
Shell :: "grep -a" example 
Shell :: git copy remote branch to local 
Shell :: npm latest version 
Shell :: new-alias vi notepad 
Shell :: Dedian/Ubuntu Self Host Your Own Website for Free 
Shell :: sudo bash 
Shell :: bash if flags 
Shell :: how know snap package size 
Shell :: chaning brach name on git 
Shell :: sort files 
Shell :: delete all files in terminal 
Shell :: git pull remote branch that does not exist locally 
Shell :: ubuntu create large file 
Shell :: conda install opencv linux server 
Shell :: react native requiring unknown modual "1" 
Shell :: command displays all the commands ran previously on the terminal 
Shell :: bash clear all environment variables 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =