Results 1 to 11 of 11

Thread: Hello GOOD DAY

  1. #1
    Join Date
    Nov 2013
    Posts
    44

    Hello GOOD DAY

    is there anyone can help me here ..

    i need a shell script that can be use like this

    sh backup.sh

    will back up /root/home/folder

    and it will zip /root/home/folder zip -r folder * all files in folder will be compressed

    VPS will send it to email and other VPS as backup

    is it possible?

  2. #2
    Join Date
    Feb 2014
    Location
    Virginia Beach, VA
    Posts
    74
    At the most basic:

    Code:
    #!/bin/bash
    
    DATE=$(date +%m-%d-%y_%H:%M)
    FILE=/root/backup-$DATE
    [email protected]
    
    zip -r $FILE /root/home/folder > /root/backup_output
    
    mutt -s "Backup" -a $FILE $MAILTO < /root/backup_output
    You need to install mutt first for this to work. And also, you didn't specify how you plan to 'send' the file to another server (ie over FTP or SSH) so I didn't put anything in there for it.

  3. #3
    Join Date
    Nov 2013
    Posts
    44
    Thank you for the response,,

    i am trying to send > received the files from VPS via EMAIL not FTP/SSH

  4. #4
    Join Date
    Nov 2013
    Posts
    44
    Quote Originally Posted by nessa View Post
    At the most basic:

    Code:
    #!/bin/bash
    
    DATE=$(date +%m-%d-%y_%H:%M)
    FILE=/root/backup-$DATE
    [email protected]
    
    zip -r $FILE /root/home/folder > /root/backup_output
    
    mutt -s "Backup" -a $FILE $MAILTO < /root/backup_output
    You need to install mutt first for this to work. And also, you didn't specify how you plan to 'send' the file to another server (ie over FTP or SSH) so I didn't put anything in there for it.
    I install mutt and try to run the shell script

    sh test.sh

    [[email protected] ~]# sh test.sh
    Can't stat /root/backup-02-11-14_14:26: No such file or directory
    /root/backup-02-11-14_14:26: unable to attach file.
    [[email protected] ~]#

    i get this error

  5. #5
    Join Date
    May 2011
    Location
    /root
    Posts
    598
    Your backup file does not exist. Did you add the correct paths to the home folder?
    || Tecsys Solutions LLC | Outperforming the Performers!! ||
    || Outsourced Server Management and Technical Support Solutions ||
    || Now Offering Secure Managed VPS and Dedicated Servers specially setup for Hosting Providers ||
    || https://www.24x7TechnicalSupport.net ||

  6. #6
    Join Date
    Nov 2013
    Posts
    44
    Quote Originally Posted by tecsys View Post
    Your backup file does not exist. Did you add the correct paths to the home folder?


    http://snag.gy/FlyzU.jpg

    #!/bin/bash

    DATE=$(date +%m-%d-%y_%H:%M)
    FILE=/root/backup-$DATE
    [email protected]

    zip -r $FILE /root/trunk > /root/backup_output

    mutt -s "Backup" -a $FILE $MAILTO < /root/backup_output

  7. #7
    Join Date
    Feb 2014
    Location
    Virginia Beach, VA
    Posts
    74
    oops

    Code:
    #!/bin/bash
    
    DATE=$(date +%m-%d-%y_%H:%M)
    FILE=/root/backup-$DATE.zip
    [email protected]
    
    zip -r $FILE /root/home/folder > /root/backup_output
    
    mutt -s "Backup" -a $FILE $MAILTO < /root/backup_output

  8. #8
    Join Date
    Nov 2013
    Posts
    44
    Thank you,, but the problem now is ,, it didnt send on email?

    the size was 90mb.. compressed with zip

  9. #9
    Join Date
    Feb 2014
    Location
    Virginia Beach, VA
    Posts
    74
    Quote Originally Posted by bugslif3 View Post
    Thank you,, but the problem now is ,, it didnt send on email?

    the size was 90mb.. compressed with zip
    Have you considered...not sending a 90MB zip file over email? You need to send by a more appropriate means, such as FTP, rsync, etc.

  10. #10
    Why do you need a back up of a folder emailed to you? Just store it on another server

  11. #11
    Join Date
    Nov 2013
    Posts
    44
    okay so if i will upload zip/compressed file automatically on 1 VPS
    what shellscript i should use.. instead of that

    and please it will send a notification on email that the back up is completed and we can see it on the BACK UP VPS

Similar Threads

  1. Good day
    By InbrecoWS-James in forum New Members
    Replies: 4
    Last Post: 02-05-2012, 10:57 AM
  2. Good Day to everyone
    By ladycooper in forum New Members
    Replies: 5
    Last Post: 11-18-2010, 11:58 AM
  3. Good day every one!
    By woodbum in forum New Members
    Replies: 3
    Last Post: 10-22-2010, 05:13 PM
  4. Good Day!
    By janecaniete in forum New Members
    Replies: 1
    Last Post: 03-25-2009, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •