Hi I am trying to send a file form one linux server into an another linux server.
I cannot do ftp get. Can anyone please assist me how can I push the file to the other server ?
Thanks. (2 Replies)
I'm trying to write a script that will start an X application if it's not already running, but will find it and pop it to the front if it is already running (maybe it's lost on a busy desktop).
Is there such a mechanism?
Here is part of the logic: VRDP="$(ps ax|grep "rdesktop .*... (3 Replies)
I need to use pushd and popd to navigate all of the subdirectories in my current directory.
I know how to get into each subdirectory, add it to the stack, and pop back out, but i cant figure out how to get into subdirectories deeper than the first without adding a foreach and if statement for... (1 Reply)
We have a cluster of 3 web servers. I'll be updating a single master server and copying info to the other 2 slave servers. What's the best way of synching all of them? Run rsync on each of the slave servers to pull the updates from the master? Or run rsync on the master to push the updates to the... (1 Reply)
Hello everyone,
I am new to Perl and I am having some issues getting a script to work. I have to create a script that uses an array of 52 cards, "shuffles" the cards (using loops with the pop, shift, and push commands), and prints out the top five. This is not a randomizing of the array just a... (2 Replies)
Hello!
Please I need some help on writing a script to push files from one server to the other once a day, everyday. I know that I can use this script on a crontab to send the files , but I am not sure how to start writing it, the actual script.
I could start by declaring some variables:
... (4 Replies)
Discussion started by: fretagi
4 Replies
LEARN ABOUT PHP
copy
COPY(3) 1 COPY(3)copy - Copies fileSYNOPSIS
bool copy (string $source, string $dest, [resource $context])
DESCRIPTION
Makes a copy of the file $source to $dest.
If you wish to move a file, use the rename(3) function.
PARAMETERS
o $source
- Path to the source file.
o $dest
- The destination path. If $dest is a URL, the copy operation may fail if the wrapper does not support overwriting of existing
files.
Warning
If the destination file already exists, it will be overwritten.
o $context
- A valid context resource created with stream_context_create(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.4 | |
| | |
| | Changed the $context parameter to actually have |
| | an effect. Previously, any $context was ignored. |
| | |
| 5.3.0 | |
| | |
| | Added context support. |
| | |
| 4.3.0 | |
| | |
| | Both $source and $dest may now be URLs if the |
| | "fopen wrappers" have been enabled. See fopen(3) |
| | for more details. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
copy(3) example
<?php
$file = 'example.txt';
$newfile = 'example.txt.bak';
if (!copy($file, $newfile)) {
echo "failed to copy $file...
";
}
?>
SEE ALSO move_uploaded_file(3), rename(3), The section of the manual about handling file uploads.
PHP Documentation Group COPY(3)