Gossamer Forum
Skip to Content



Home : General : Internet Technologies :

prompt how to auto accept (yes/n0)

Quote Reply
prompt how to auto accept (yes/n0)
Hi there,

Im writing a simple archive shell script that will simply gzip a file via cron.

Now the file that is being gzip'ed , there is already another copy of it and cron wont run it as there is already a copy of it :(

How can I have the script so that it will auto overwrite the existing file?

Thanks a lot.
Quote Reply
Re: [roi8877] prompt how to auto accept (yes/n0) In reply to
Maybe something like;

if (-e '/path/to/file.txt') { system("rm -f /path/to/file.txt"); }

This assumes you are on a UNIX server.

Cheers

Andy (mod)
andy@ultranerds.com



Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [roi8877] prompt how to auto accept (yes/n0) In reply to
Running into the same problem myself using gpg.

My temporary solution is to create the file, then email it (or ftp it) to myself and then delete (unlink) the file from the server so the next time the script runs it doesn't ask for any input.

Another way would be to perhaps incorporate today's date into the filename?

Last edited by:

Watts: Jan 19, 2004, 7:30 AM