Results 1 to 6 of 6
i have 2 txt files
usr/local/minecraft_server/vip/whitelist.txt
usr/local/minecraft_server/public/whitelist.txt
and i want them to copy over to
/path/to/www/minecraft/files/vip/whitelist.txt
/path/to/www/minecraft/files/public/whitelist.txt
Maybe a simple backup script would do it but the file has to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-27-2013 #1Just Joined!
- Join Date
- Jan 2013
- Posts
- 7
copying txt files
i have 2 txt files
usr/local/minecraft_server/vip/whitelist.txt
usr/local/minecraft_server/public/whitelist.txt
and i want them to copy over to
/path/to/www/minecraft/files/vip/whitelist.txt
/path/to/www/minecraft/files/public/whitelist.txt
Maybe a simple backup script would do it but the file has to stay in original directory and be copied to the web directory for viewing on the forum.
I want it to do this once every 30 mins or hour
I have been using linux for a few months but never explored its capabilities, maybe now is the time i should do it.
This is my first ever post or request for help and i did do a bit of googling before pesetering you guys here with what seems like a stupid noob question to some of you..
i look forward to your reply
ty in advance
rebz
- 01-27-2013 #2
Welcome!
This looks like a job for cron (see man cron). However, maybe a symlink will do.
- 01-27-2013 #3Just Joined!
- Join Date
- Jan 2013
- Posts
- 7
- 01-27-2013 #4Linux Guru
- Join Date
- Oct 2007
- Location
- Tucson AZ
- Posts
- 2,517
The copy command has a lot of options. If you simply want to copy from the example above you could do: cp /usr/local/minecraft_server/vip/whitelist.txt /path/to/www/minecraft/files/vip/whitelist.txt
To find options, you can open a terminal and just type: man cp. If that is too cryptic for you, you should be able to find thousands of sites with basic info on the Linux copy command. The site below has some explanations and examples, might be worth your while to take a look:
Linux and UNIX cp command help and examples
How to use the cp command, by The Linux Information Project
The reference to cron above is that it is used to run scripts at a set time on a regular basis. There are also an extremely large number of sites with explanations and tutorials:
http://www.linuxweblog.com/crotab-tutorial
- 01-28-2013 #5Just Joined!
- Join Date
- Jan 2013
- Posts
- 7
all way over my head ill try askin for help on a diff forum, thanx for ur replies
- 01-29-2013 #6
Basically, if there is a file that gets updated in regular basis and I want it to be present in another location I'd use (sym)linking. If it does not work for some reason, like chroot or jail I'd use cron to copy it over ... maybe. There may be better solutions ... just the description of problem is not very detailed.


Reply With Quote

