Topic "question about cronjobs and sshd"

Author Message
xykapec

Guest


Hi guys!

I am pretty new in all this scripting, and its very hard for me.
I am not sure if this is right forum to ask, but I will try:)

My problem is:
I am trying to install automatic updates for vsp - statistics script for quake 3.

My server (where my quake 3 osp game is running) has no fpt, but only ssh.

My hosting (where I run all the scripts) has cron job enabled and sshd.

I think about adding three jobs via cron:

1) Download file myserver.log from my server to my hosting via sshd.
2) If first job completed OK, then delete myserver.log from server.
3) Let vsp.php to generate stats from downloaded file myserver.log.


Is it possible in my case to download file myserver.log? Can I use sshd for downloading file from server that has ssh?

Can anyone help me with writing cronjob line for such downloading?
I need also cronjob line for deleting file.

If you want to help me, then please, write everything simple as possible, for dummy:)

Thank you.
Waiting for your answer!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
xykapec wrote:
Is it possible in my case to download file myserver.log? Can I use sshd for downloading file from server that has ssh?

SSH only is not enough. You need also SCP or SFTP. But these are usually bundled.

Quote:
Can anyone help me with writing cronjob line for such downloading?
I need also cronjob line for deleting file.

Please read documentation and linked examples.
_________________
Martin Prikryl
Guest




Thank You!

I have SFTP in my server too! Cool

When I will solve my problem finally I will post about it here.
xykapec

Guest


It was me:)
xykapec

Guest


I cant understand nothing in this scripting:(

I need:

1) Download file myserver.log from my server to my hosting via sshd (sftp is supported by server).
2) If first job completed OK, then delete myserver.log from server.
3) Let vsp.php to generate stats from downloaded file myserver.log.
Cron line example for running vsp.php:

0 5 * * * php /full/path/to/vsp.php -l q3a -p savestate 1 "games.log"

Can Anyone to give me step by step solution for my problem?
I think it should consists of several cron lines
1) downloading
2) checking if file is really downloaded
3) generating stats.

I will really appreciate if someone will help me.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Looks like your server is not a Windows platform. Hence you cannot use WinSCP. So my link to its documentation is worthless.

About cron: I guess you should have a single (schell) script do perform all the steps and run it using single cron line. To transfer files, Unix "scp" command would be easiest to use.
_________________
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