Placing a copy of every file uploaded in a given directory.

Hello.

I use Linux/Apache/PROFTP/PHP etc on my dedicated server.

I would like for a backup copy of every file added to my /home/webadmin/html/pages/ dir to autoamically be created (with a timestamp for a name) and placed in my /home/backup/ folder.

How can this be done?

Thanks!
LVL 16
hankknightAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jase-CoderConnect With a Mentor Commented:
in the script that uploads the file add cp <filename> <path>

in your langauge used there will be functions that allow you to call the system functions.

I would write a shell script that copies the file to another directory and call the shell script from with in the file that uploads thefile file the user is uploading.
0
 
hankknightAuthor Commented:
Can this be done for files that are uploaded with FTP ?
0
 
Jase-CoderCommented:
I think so, You could run the script once someone has logged in. You'll also have to make it check for new files that have been added to the directory. i.e. been uploaded
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.