tar the last periodic backup that is in another path and move the tar to some dir
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
tar the last periodic backup that is in another path and move the tar to some dir
I want to make a script that have to take "get or mv" the tar file from another path. The script make a tar of the last periodic backup (PB). The PB have the same name with diferent date. When the script find the last PB make a tar and move the tar file in other path. Could some one help, please?
For this part I haven't nothing, 'cause I have three machine. I take archives in one to put in another, 2nd one, for this I use a perl script. Then I want to take the periodic backup and put this in the same dir with the archives that came from 1st machine. Then I'll make a tar of this dir and put in the 3rd machine. I just make an experience using "find -mtime", but is not what I looking for.
$ftp = Net::FTP->new($ftp_server1, Passive => 1) or die "unable to connect: $@\n";
$ftp->login($ftp_uid1, $ftp_pw1) or die "unable to login: $@\n";
$ftp->cwd($ftp_dir) or die "Cannot change working directory ", $ftp->message;
$ftp->binary;
$ftp->get($ftp_file1) or die "Cannot list directory ", $ftp->message;
$ftp->get($ftp_file2) or die "Cannot list directory ", $ftp->message;
Well, that code looks basically ok; what happens when you run it?
Obviously it needs some code to get/set vars first, but just to test you can hardcode them.
I didn't put all the code. but I set vars first. But this script is only to get the files there need to put in the 2nd machine using FTP. Now I want to tar the last periodic backup and move it to some directory. Could some one help. how can I do it?
no, I don't want to make it using perl, I want to use shell script, 'cause my machine is using an old solaris version and in perl archives I don't have the tar.pm... I made a download of it and put it in the right directory, but is not working...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.