Files selection

Advertisement

clientvoip
Joined:
Posts:
4

Files selection

Hi,

I want download the files from remote directory.
But I want download only the files with data previous the current data.
I explain, for example now is 12 Dec. The remote directory contains a lots of files/directories but I want download only the files with data previous the 12 Dec.

Can I obtain the system data (yymmdd and hhmmss)?
Can I compare the system data with the directory/file data?

I want write a file .scp for the download, but I don't know how

Reply with quote

Advertisement

clientvoip
Joined:
Posts:
4

Re: Files selection

martin wrote:

Do you want to do that with scripting or from GUI?
I want to write a file scp that:
1) open a connection to remote machine
2) create a remote directory (system current data_backup)
3) launch a specific remote command (I know the specific command)

The point 1 and 3 aren't problems, but the point 2 yes.
I don't know how obtain the system current data (yymmdd and hhmmss).
The commands time or data don't work correctly.

Could you help me?

Thanks

Reply with quote

clientvoip
Joined:
Posts:
4

Re: Files selection

martin wrote:

You can try something like:
call mkdir `date +%Y%m%d%H%M%S`
Hi,
thanks for your answer.
Sorry, but now I have other questions:
1) I want assign a value to a variable (for example BCK = backup)because I want create a variable directory (BCK_system time). The system time isn't the problem because I use "call date" command but I don't know how append the BCK value with the output of the command date.

2) I want send a specific remote command (./specific command) from the scp file, but I don't know how.

Could you help me, please?
Thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,505
Location:
Prague, Czechia

Re: Files selection

clientvoip wrote:

1) I want assign a value to a variable (for example BCK = backup)because I want create a variable directory (BCK_system time). The system time isn't the problem because I use "call date" command but I don't know how append the BCK value with the output of the command date.
Do you mean something like:
call mkdir `date +%Y%m%d%H%M%S"backup"`
[/quote]
or
call mkdir `date +%Y%m%d%H%M%S"$BCK"`
[/quote]

2) I want send a specific remote command (./specific command) from the scp file, but I don't know how.
Thanks what "call" does: "call specific_command".

Reply with quote

Advertisement

You can post new topics in this forum