Instruct WGET to only download the same file if the existing one is older [closed] - command

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
As the question states how to instruct WGET to only download the same file if the existing one is older
e.g. fileA has a date / file stamp of 9.00AM 10/10/2011
e.g. fileA on the remote server has a date / file stamp of 11AM 10/10/2011
so wget will download FileA on the server as its newer (and overwrite the local file)
Any help would be greatly appreciated, I have heard this is possible, but after looking around for a while I havn't come up with anything

Take a look at the timestamping section in the wget manual:
Time-Stamping
One of the most important aspects of
mirroring information from the
Internet is updating your archives.
Downloading the whole archive again
and again, just to replace a few
changed files is expensive, both in
terms of wasted bandwidth and money,
and the time to do the update. This is
why all the mirroring tools offer the
option of incremental updating.
Such an updating mechanism means that
the remote server is scanned in search
of new files. Only those new files
will be downloaded in the place of the
old ones.
A file is considered new if one of
these two conditions are met:
A file of that name does not already
exist locally.
A file of that name
does exist, but the remote file was
modified more recently than the local
file.
To implement this, the program
needs to be aware of the time of last
modification of both local and remote
files. We call this information the
time-stamp of a file.
The time-stamping in GNU Wget is
turned on using ‘--timestamping’
(‘-N’) option, or through timestamping
= on directive in .wgetrc. With this option, for each file it intends to
download, Wget will check whether a
local file of the same name exists. If
it does, and the remote file is not
newer, Wget will not download it.
If the local file does not exist, or
the sizes of the files do not match,
Wget will download the remote file no
matter what the time-stamps say.

wget -N http://server/path/to/file.txt

Related

Unknown version of Tomcat was specified. tomcat 8.5 linux [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Here is my problem
Eclipse only recognizes my version 7 of tomcat ...
However it remains a mistake ... it does not find the jre. Ideas ?
I assume that you've already do that but if you get this issue, it means you certainely make wrong in one of these steps. So let me describe steps:
Go to tomcat site's download page for version 8: http://tomcat.apache.org/download-80.cgi
Download the desired version (in this case, 8.5.15) for linux so the tar.gz in the Core sub-part. Manually or with curl (before that, move in the folder you want to download the compressed package):
cd /tmp (for example)
curl -O http://www-eu.apache.org/dist/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.tar.gz
Verify integrity of the downloaded tar.gz with MD5 or SHA1 (optional but it sometimes reserves a few surprises)
Uncompress the package where you want so:cd /usr/local and tar zxvf apache-tomcat-8.5.15.tar.gz
Make sure the JAVA_HOME variable is correctly defined because Tomcat needs it to work
Add a new server runtime so: Windows>Preferences>Server>Runtime Environment
Then, add button. Select "Apache Tomcat v8.5" on the list. Next, then browse to select the correct directory /usr/local/* . Actually, you need to choose the directory which directly contains bin, conf, lib and so on.
And it will work fine
Let me know if you fix the problem or if it persists.

virtual environment requirements.txt [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would like to put a requirements.txt file in my virtual environment. The two ways I have thought about are making a txt file and then moving it to the correct directory (I do not know how to find the directory: when I type workon, the PathToScripts and PathToSitePackages says C:\Users\A.virtualenvs...) and making a requirements.txt file once I am in the directory (I know not how to make a file while in the correct directory). Are any of my ideas a good way to go about solving this problem? Is there a better way to do this?
The normal thing to do is to put the requirements.txt file in the the root of your application source code. This way you can place it under version control with the rest of your application artifacts. That's what virtualenvwrapper expects you to do. It's why virtualenvwrapper distinguishes between the directories where the virtual environments are created and the working directory you specify when creating one. I understand why you might want to put requirements.txt in with the virtual environment, but it's not the usual way.
There might be a way to specify that the virtual environment directory be the same as the working directory. You could try specifying that the working directory be the same as where the virtual environment gets built when you create it, our again you could edit the file after the fact. But it's not really the way people usually do things.
You'll have to look in the docs for the directory where the vms are created for the os you're using. Under Linux they get get put into a hidden directory in your home.

How to recover the deleted files using "rm -R" command in linux server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have unfortunately deleted some important files and folders using 'rm -R ' command in Linux server.
Is there any way to recover?
since answers are disappointing I would like suggest a way in which I got deleted stuff back.
I use an ide to code and accidently I used rm -rf from terminal to remove complete folder. Thanks to ide I recoved it back by reverting the change from ide's local history.
(my ide is intelliJ but all ide's support history backup)
Short answer: You can't. rm removes files blindly, with no concept of 'trash'.
Some Unix and Linux systems try to limit its destructive ability by aliasing it to rm -i by default, but not all do.
Long answer: Depending on your filesystem, disk activity, and how long ago the deletion occured, you may be able to recover some or all of what you deleted. If you're using an EXT3 or EXT4 formatted drive, you can check out extundelete.
In the future, use rm with caution. Either create a del alias that provides interactivity, or use a file manager.
Not possible with standard unix commands. You might have luck with a file recovery utility. Also, be aware, using rm changes the table of contents to mark those blocks as available to be overwritten, so simply using your computer right now risks those blocks being overwritten permanently. If it's critical data, you should turn off the computer before the file sectors gets overwritten. Good luck!
Some restore utility:
http://www.ubuntugeek.com/recover-deleted-files-with-foremostscalpel-in-ubuntu.html
Forum where this was previously answered:
http://webcache.googleusercontent.com/search?q=cache:m4hiPw-_GekJ:ubuntuforums.org/archive/index.php/t-1134955.html+&cd=1&hl=en&ct=clnk&gl=us

Windows 7 64 Bit/Save mode: Rename msi.dll not possible [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Due to problems with the windows installer 5 I must rename msi.dll for reinstallation. That's not possible in save mode/as administrator (access denied). Of course the service is stopped. Any hints?
Edit: My problem is that I can't install msi files anymore. Everytime after some dialogs I get an error message that the corresponding msi file can't be read. I have tried any infos I found in the www universe and lost a lot of time already. E. g. I replaced the registry settings, used sfc /scannow without success.
In Windows 7 there is no dllcache, so I really don't know what is preventing renaming.
My problem is that I can't install msi files anymore. Everytime after some dialogs
I get an error message that the corresponding msi file can't be read
This sounds a little bit strange. If you see MSI dialogs and the install fails when you kick it off there must be something else wrong. I assume you have, but have you verified that the problem exists with multiple MSI files? Try with a fresh MSI file, preferably one that you downloaded fresh from the Internet. Try to run from the local disk and from a network disk.
Have you enabled logging for the install? Try to do so with flush to log enabled (the ! character enables continuous flushing to log so that an msiexec.exe crash doesn't leave an empty log file):
msiexec.exe /i C:\Path\Your.msi /L*vx! C:\Your.log
See msifaq.com for more details (logging faq entry). Search for "value 3" in the log file to find errors as explained by Rob Mensching (Wix & Orca author).
Also try to disable any anti virus software and / or desktop security that may be interferring with the file extraction from the MSI's cab file. Is there plenty of disk space? Are there any errors found during a disk scan?
Are you trying to revert to a previous version of Windows Installer? Here is some information: http://support.microsoft.com/?kbid=315346.
I suppose you could use system restore as well, but that would have other side effects.
What is the overall problem? Windows Installer 5 does not seem to introduce anything very controversial: http://msdn.microsoft.com/en-us/library/windows/desktop/dd408114(v=vs.85).aspx

Restore postgresql from files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have a big problem - I managed to accidentally uninstall the whole PostgreSQL DBMS from my hard drive. I also lost my database and haven't made any dumps of the containing data. I do, however, have a backup of all files from the server. Is it possible to somehow restore the database from these files?
The OS I am using is Debian 6, and the DBMS version is PostgreSQL 8.4.
If it is indeed possible, then how should I go about achieving this?
ps. Sorry for my English.
Make sure your backup is safe. So long as we have that we can start again.
Restore the PostgreSQL server software (check package titles)
apt-get install postgresql-8.4 postgresql-client-8.4 postgresql-contrib-8.4
Stop the server
/etc/init.d/postgresql stop
Restore all your data files. Make sure the ownership is correct:
cd /var/lib/postgresql/8.4/
mv main main.OLD
cp -a /path/to/backup/main .
/etc/init.d/postgresql start
Check the logs (/var/log/postgresql/...) - if your backup occurred while the database was idle you are probably in luck.
Note that you need everything in .../main/ - the database files are in main/base but there are the transaction logs and other assorted bits and pieces needed too.
If you get problems, check your permissions, check your postgresql.conf file (restore that from backup too if you have it, pg_hba.conf etc too). There might be some other packages you need to install too if you were using pl/perl or some such earlier
Now. if you get problems complaining about missing log-files or bad blocks then that means the backup happened while the database was writing to the disk and there may be corruption. However, let's be optimistic and hope for the best.
If it works, check everything looks OK and take a pg_dump of any databases you want straight away.