Add line to remote txt-file

morpheus93

Client
Регистрация
25.01.2012
Сообщения
395
Благодарностей
41
Баллы
28
I run ZP on one server and need to add line by line to a textfile that is located on another server. What is the easiest approach to do that? Thank you.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
3 881
Благодарностей
914
Баллы
113
I run ZP on one server and need to add line by line to a textfile that is located on another server. What is the easiest approach to do that? Thank you.
The database is the correct way.
Other possibilities is dropbox, but if your bots work simultaneous or with more than one thread then this will make problems.
Another way is to use FTP.
 
  • Спасибо
Реакции: morpheus93

morpheus93

Client
Регистрация
25.01.2012
Сообщения
395
Благодарностей
41
Баллы
28
Thank you lokiys for your help. Yes, I already considered the problems that can occure with multithreading or a couple of bots are using the same file...
Database solution should workaround this problem? But then I have to alter a bunch of my projects and their logic.
With FTP... would that be "multi-threading/access" safe?

Saw an tutorial using C# on how to add a line to an (external) text-file. But looks quite complicated and not sure if this also works on a remote server.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
3 881
Благодарностей
914
Баллы
113
Thank you lokiys for your help. Yes, I already considered the problems that can occure with multithreading or a couple of bots are using the same file...
Database solution should workaround this problem? But then I have to alter a bunch of my projects and their logic.
With FTP... would that be "multi-threading/access" safe?

Saw an tutorial using C# on how to add a line to an (external) text-file. But looks quite complicated and not sure if this also works on a remote server.
I do not think FTP would be good in multithreading too. It ll depends on your logic, but think if you will use the same file from two different places file should be locked when one side is working with it, otherwise, You will have problems, it does not really matter what solution you use.
To be honest with database same story, DB should be locked when one side is working with data. If you will use simple DB action what you can find in zennoposter then this is not bullet-proof solution. anyway. Again all depends on your thread count and logic.

The easiest way that comes in mind would be to use separate files on each server and then use just one threaded bot that updates some main file.
The same approach I would make for DB, each bot would have separate tables and then some method that updates the main table with info from both tables.

In any way, DB is the best solution.
 
  • Спасибо
Реакции: morpheus93

morpheus93

Client
Регистрация
25.01.2012
Сообщения
395
Благодарностей
41
Баллы
28
I think I will try a DB solution or maybe have a look again in the C# thing. Also found something about an solution via Powershell and cmdlet that is supposed to add lines to a remote text-file but haven't tested it yet.

If it works I will post it here.

Thank you.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
15 945
Благодарностей
3 892
Баллы
113
I suggest you using Google tables.
We've added it in version 7.1.1.0. which is available as test build currently.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
3 881
Благодарностей
914
Баллы
113

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)