Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I have little experience in Linux, so I ask for help. I need a script to do: 1 .- Compress (zip) entire directories (subdirectories-files) to a folder that is ...
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    4

    Unhappy I need support in script

    Hi,

    I have little experience in Linux, so I ask for help.
    I need a script to do:

    1 .- Compress (zip) entire directories (subdirectories-files) to a folder that is /backup. The directory is called /work
    2 .- Rename the zip file with the name /backup/backupdir_% date%. zip
    3 .- Make a MySQL dump and compress as /backup/mysql_% date%. zip
    4 .- Make a put to a public FTP.
    5.- Delete all files of /backup/

    Explanation: the second time running the point 1 must only compress those files or directories that are updated.

    Thanks

    OS RedHat 5.3 x64

  2. #2
    Linux Newbie Ziplock's Avatar
    Join Date
    Jan 2009
    Location
    Adelaide
    Posts
    169
    What have you got so far? I would suggest using the tar command for the backup, with the --incremental-listed option to create your backup files. See the tar manpage for more information on the options that are available. It will create a tar.ga file, not a zip file.

    Code:
    tar czf /backup/backup-$(date %Y%m%d).tar.gz --listed-incremental /work
    You will need to stop mysql before backing it up,

    Code:
    service mysql stop
    Not sure what scripting language you want to use, but if using bash or equivalent, you can just use the FTP command to push the files to the remote server.

  3. #3
    Just Joined!
    Join Date
    Nov 2008
    Posts
    4
    Hi!!

    I perform scripts in Windows but I've never worked in linux with it. As serious as the script and I running it?

    Thanks

Posting Permissions

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