Very basic backup script with tar command & date stamp.
[ramank@raman ~]$ cat back.sh
#back-up script with date wise
#!/bin/bash
RK=tempbackup$(date +%Y%m%d).tgz
tar -czf $RK /tmp
In above script,i define variable in 3rd line i,e RK & in 4 line create tar file of Temp dir.
For execute change the permission, like +x or 777.
After run the script, output like this.
tempbackup20120313.tgz
[ramank@raman ~]$ cat back.sh
#back-up script with date wise
#!/bin/bash
RK=tempbackup$(date +%Y%m%d).tgz
tar -czf $RK /tmp
In above script,i define variable in 3rd line i,e RK & in 4 line create tar file of Temp dir.
For execute change the permission, like +x or 777.
After run the script, output like this.
tempbackup20120313.tgz