Topic "Files selection"

Author Message
clientvoip
[View user's profile]

Joined: 2006-12-11
Posts: 4
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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Do you want to do that with scripting or from GUI?
_________________
Martin Prikryl
clientvoip
[View user's profile]

Joined: 2006-12-11
Posts: 4
prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
You can try something like:
Code:
call mkdir `date +%Y%m%d%H%M%S`

_________________
Martin Prikryl
clientvoip
[View user's profile]

Joined: 2006-12-11
Posts: 4
prikryl wrote:
You can try something like:
Code:
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
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:
Code:
call mkdir `date +%Y%m%d%H%M%S"backup"`
[/quote]
or
Code:
call mkdir `date +%Y%m%d%H%M%S"$BCK"`
[/quote]

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".
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License