LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-25-2013, 01:03 AM   #1
danykallery
LQ Newbie
 
Registered: Oct 2006
Location: Kerala, India
Distribution: RedHat, Fedora, Cent OS
Posts: 26

Rep: Reputation: 0
Moving a last dated backup to remote location.


Hi,

I am taking a backup of one HDD Drive which contatins all the databackup on daily basis. i want to take once in a week the latest backup to the remote location. but i tried many scripts none of them working. can some one help me to done this.

for example. i have 1,2,3,4,5 dates backup. on a perticular day i have to take the latest backup file to remote desktop. here on 5th day backup i have to take.

waiting for ur responds...

Thanks in advance
 
Old 03-25-2013, 05:07 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,474

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Use ls -t and take the first result, roughly:

Code:
cd /backups
LATEST=`ls -t backup*.tgz | head -n 1`
scp ${LATEST} myname@remotehost:/backups
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
office calc moving macro location knobby67 Linux - Software 0 09-18-2012 07:14 AM
how can backup a remote server(only folder needed) with ftp ,daily backup? ahjafari Linux - Newbie 1 10-26-2011 04:04 PM
Moving the trash location quetzyl Linux - Newbie 1 03-17-2011 11:32 AM
Cannot Open CHM Files In Windows XP When Moving From Default Location Keemoch_Styling General 0 07-09-2009 10:35 AM
Moving a server from one location to another khb Linux - Server 7 07-29-2008 08:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration