question about cronjobs and sshd

Advertisement

xykapec
Guest

question about cronjobs and sshd

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!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: question about cronjobs and sshd

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.

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.

Reply with quote

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
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.

Reply with quote

Advertisement

You can post new topics in this forum