08-15-2008
Having a program check /proc/pid/fd and compare to your /tmp directory would be very slow. As such, you would have to rewrite the open() function (or sys_open() in the kernel). Either you create a program and use LD_PRELOAD to "stop" the open() function and only allow it to continue after a backup is made or you create a kernel module // modify the kernel to change the system call (sys_open()) or the actual internal function do_open() and also backup before allowing them to continue.
Or, if you just wanna keep it simple, read the documentation on your uploading program and it should allow backups of uploaded files.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hey all,
i am a shell scripting n00b so bear with me. i got a server that every night uploads one file to a remote server. the file is prodserver_date_time.
i would like to make a script, run by root on a daily cron job. i want it to determine if the file was received or not. no md5... (2 Replies)
Discussion started by: jweinraub
2 Replies
2. Shell Programming and Scripting
Hello friends,
I'm newbie in shell scripting...
Until now i have this script:
#!/bin/sh
emailok = email1@domain.com
emailissue = email2@domain.com
limit="50"
df -h | grep -vE '^Filesystem' | awk '{print $1 " " $4 " " $5}'|while read val
do
partition=$(echo $val | awk '{print... (9 Replies)
Discussion started by: john_doe
9 Replies
3. Shell Programming and Scripting
hi,
i want to monitor a particuler folder and have to report is there any new file added to the dir or not? can anyone tell me how to monitor the folder using script. the script has to run in the background continiously. Is there any way to do it? (2 Replies)
Discussion started by: vij_krr
2 Replies
4. Shell Programming and Scripting
Hi everyone!
I'm in a need of a shell script that search for all files in a folder, move all those files to a temp folder, and upload those files via FTP. When the file transfer via FTP completes successfully, the file is moved to a completed folder. In case any of those files fails, the file... (4 Replies)
Discussion started by: pulsorock
4 Replies
5. Shell Programming and Scripting
Hi All,
Is there any way to monitor a command inside shell script ? I have a script inside which I have a tar command which zips around 200GB data.
tar zcvf $Bckp_Dir/$Box-BaseBackup-$Day.tar.gz * --exclude 'dbserver_logs/*' --exclude postmaster.pid --exclude 'pg_xlog/*'
I want to... (3 Replies)
Discussion started by: sussus2326
3 Replies
6. UNIX for Advanced & Expert Users
Hello All,
We are having a archiving script which runs every monday.
When ever the script runs it creates crout* files in /tmp folder.
This file appends till /tmp become 100% full.
We are facing this problem now very frequently.
We caanot delete this files,we have to kill the script.
when we... (5 Replies)
Discussion started by: Upendra Bhushan
5 Replies
7. Shell Programming and Scripting
Hi,
facing an issue while calling sqlplus inside shell script. It for some reason goes to tmp file to write something and i get error as permission denied as i dont have access there.
ANy idea why sqlplus writes in /tmp and how to change or stop this ? (2 Replies)
Discussion started by: rushikeshs
2 Replies
8. Shell Programming and Scripting
Hi,
i need help on shell scripting.
Main intention of the script is
step 1: ssh to remote server
Step 2: cd /tmp in remote server
Step 3: in tmp i want to grep only files and directories which are in GB sizes
All the servers list file is - tmpsrv.txt
vi tmpsrv.txt
... (17 Replies)
Discussion started by: kumar85shiv
17 Replies
9. Homework & Coursework Questions
Hi Experts,
I am not good in writing script. Just stared. I am looking for shell script to check following parameters.
1) Number of files on remote Linux SUSE server.- Any directory and sub directory.
2) I should define number of files in script. Files should be variable.
3) Age of the... (2 Replies)
Discussion started by: ApmPerfMonitor
2 Replies
10. Shell Programming and Scripting
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
LEARN ABOUT LINUX
install
INSTALL(1) User Commands INSTALL(1)
NAME
install - copy files and set attributes
SYNOPSIS
install [OPTION]... [-T] SOURCE DEST
install [OPTION]... SOURCE... DIRECTORY
install [OPTION]... -t DIRECTORY SOURCE...
install [OPTION]... -d DIRECTORY...
DESCRIPTION
This install program copies files (often just compiled) into destination locations you choose. If you want to download and install a
ready-to-use package on a GNU/Linux system, you should instead be using a package manager like yum(1) or apt-get(1).
In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to the existing DIRECTORY, while setting permission modes and
owner/group. In the 4th form, create all components of the given DIRECTORY(ies).
Mandatory arguments to long options are mandatory for short options too.
--backup[=CONTROL]
make a backup of each existing destination file
-b like --backup but does not accept an argument
-c (ignored)
-C, --compare
compare each pair of source and destination files, and in some cases, do not modify the destination at all
-d, --directory
treat all arguments as directory names; create all components of the specified directories
-D create all leading components of DEST except the last, then copy SOURCE to DEST
-g, --group=GROUP
set group ownership, instead of process' current group
-m, --mode=MODE
set permission mode (as in chmod), instead of rwxr-xr-x
-o, --owner=OWNER
set ownership (super-user only)
-p, --preserve-timestamps
apply access/modification times of SOURCE files to corresponding destination files
-s, --strip
strip symbol tables
--strip-program=PROGRAM
program used to strip binaries
-S, --suffix=SUFFIX
override the usual backup suffix
-t, --target-directory=DIRECTORY
copy all SOURCE arguments into DIRECTORY
-T, --no-target-directory
treat DEST as a normal file
-v, --verbose
print the name of each directory as it is created
--preserve-context
preserve SELinux security context
-Z, --context=CONTEXT
set SELinux security context of files and directories
--help display this help and exit
--version
output version information and exit
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup
option or through the VERSION_CONTROL environment variable. Here are the values:
none, off
never make backups (even if --backup is given)
numbered, t
make numbered backups
existing, nil
numbered if numbered backups exist, simple otherwise
simple, never
always make simple backups
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report install bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report install translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for install is maintained as a Texinfo manual. If the info and install programs are properly installed at your
site, the command
info coreutils 'install invocation'
should give you access to the complete manual.
GNU coreutils 8.5 February 2011 INSTALL(1)