Hot answers tagged

92

Try -m for --mirror wget -m ftp://username:password@ip.of.old.host


47

How deep do your subdirectories go? /var/log/basedir/*.log /var/log/basedir/*/*.log { daily rotate 5 } Will rotate all .log files in basedir/ as well as all .log files in any direct child of basedir. If you also need to go 1 level deeper just add another /var/log/basedir/*/*/*.log until you have each level covered. This can be tested by using a ...


24

How can I debug this problem and find the offending nameserver? daxd5 offered some good starting advice, but the only real answer here is that you need to know how to think like a recursive DNS server. Since there are numerous misconfigurations at the authoritative layer that can result in an inconsistent SERVFAIL, you need a DNS professional or online ...


23


19

lftp should be able to do this in one step, in particular with lftp mirror: EDIT: the lftp command syntax is confusing, original invocation I posted doesn't work. Try it like this: lftp -e "mirror -R {local dir} {remote dir}" -u {username},{password} {host} note the comments around the arguments to the -e switch.


15

find . -type d -perm 777 -exec chmod 755 {} \; (for changing the directory permission) find . -type f -perm 777 -exec chmod 644 {} \; (for changing the file permission) If they did not have 777 permissions, we easily remove the -perm 777 part.


10

rm -r /path/to/directory/* or rm -rv /path/to/directory/* if you want to see what is happening.


9

find dir/ -path '*/.svn' -prune -o -type f -print should fit the bill (mostly comes from the find manpage for -path). Pipe it to less and check it out. What it does is first find (path ends in .svn and don't recurse into (prune) this directory) or (if it's a file, print it). If it looks good, change it to find dir/ -path '*/.svn' -prune -o -type f -...


7

You would need to run 2 commands I believe. This is one way to do it: # find . -mindepth 1 -type d | xargs chmod 700 # find . -mindepth 2 | xargs chmod 700 The first does directories at the current directory level and deeper. The second does all files and directories deeper than the current directory.


7

find is your friend. I reckon the following ought to do it: find <target_dir> -not -name \*.bz2 -exec bzip2 \{\} \; i.e. if the dir where the files you want to bzip are is /var/log/blah it would be: find /var/log/blah -not -name \*.bz2 -exec bzip2 \{\} \;


6

What about the -path option to find? find . -type d ! -path '*.svn*'


6

What about simply find . -type d | grep -v '.svn'


6

besides wget, you may also use lftp in script mode. the following command will mirror the content of a given remote FTP directory into the given local directory, and can be put into the cron job: lftp -c 'open <hostname>; user <username> <password>; mirror -e <remote-src-path> <local-dest-path>; quit' it automatically handler ...


6

Directly: No, an error is returned that A group cannot be a member of itself Indirectly: There is nothing preventing this from happening in Active Directory, and is known as Circular Group Nesting.


6

Yes, it can, if the underlying CPUs support the latest virtualization extensions (Intel VT-X/EPT) and if you're using the latest VMware products (Workstation 8, ESXi 5). The relevant settings in your VM should be as follows: monitor.virtual_mmu = "hardware" monitor.virtual_exec = "hardware" vhv.enable = "TRUE" hypervisor.cpuid.v0 = "FALSE" The first ...


5

You can use 'curlftpfs - mount a ftp host as a local directory' and, once mounted, you can use normal file tools like 'cp -r'.


5

No you don't need to have recursion on for authoritative DNS servers. Depending on who you ask it's even considered good practice that (if possible) your authoritative server not be recursive as it's a line of defence against some DoS attacks. (Cisco's document is here for example) A sample from my domain is below (Server is running Bind 9 and is non-...


5

Regardless of the permissions: chmod -R a=r,a+X,u+w /your/path


5

Per Zoredache... why not: find /foo/temp_folders/ -type f -iname * -exec rm {} + Edit: changed the trailing \; to + for performance as noted here


5

So, in order to curb everyone joking around, here's a serious answer: To do something recursively in this context means to apply whatever it is that you're doing to all the children of the object you're applying it to. So, doing chown $HOME takes ownership of your home folder, but only the home folder, nothing inside it. Doing chown -R $HOME (note the ...


5

While you are indeed seeing that the authoritative name servers are responding correctly, you need to follow up the entire chain of DNS resolution. This is, walk down the whole DNS hierachy from the root servers up. $ dig net NS ;; ANSWER SECTION: net. 172800 IN NS c.gtld-servers.net. net. 172800 IN NS f.gtld-servers.net. net. ...


4

This will change the permissions of every directory in the current directory and all files and folders within them, I think that's what you want but be careful because of the recursion... find . -maxdepth 1 -type d -exec chmod -R 700 {} \;


4

You're modifying inodes and not files, it should be fairly quick. Last time I did that it took under a minute on our old LTSP boxen. You've made a bunches of changes already if it worked at all. But it's generally a bad idea to do such indiscriminate changes. Update based on the comments: @wombats You need to set up another directory on the box, set up a ...


3

You may use find for this or maybe, with a loop, for: for directory in parent/*; do if [ -d $directory ]; then chmod -R 700 $directory; fi ;done


3

Check below wget command to download data from FTP recursively. wget --user="" --password="" -r -np -nH --cut-dirs=1 --reject "index.html*" "" -r : is for recursively download. -np : is for no parent ascending. -nH : is for disabling creation of directory having name same as URL i.e. abc.xyz.com --cut-dirs : is for ignoring no. of parent directories. ...


3

In my case, the depth of subdirectories can change without warning, so I set up a bash script to find all subdirectories and create a config entry for each directory. It's also important for me to keep the structure of subdirectories after rotation, which wildcards (i.e. @DanR's answer) didn't seem to do. If you're doing daily logrotations, you could put ...


3

Wow... that's pretty bad... The best thing you can do now is back up your personal data and reinstall your system. Since that's probably not what you wanted to hear, the second best (and probably substantially more painful) thing to do is something like: for package in `dpkg -l | awk '{print $2}'`; do apt-get install --reinstall $package done Note ...


3

There are different answers to this question. Before WS2016/W10, the correct answer was: Yes, you can enable the Hyper-V role in a Hyper-V VM, but the hypervisor would not start. Therefore, you could create VMs in the vHost, but those VMs could not start. However, in Windows 10 and WS2016 (TP4 and later) we can use nested Hyper-V. If you're mad enough to ...


3

Yup, that's a good response - notice the NXDOMAIN status, which means it's saying "nothing there" to the client. Since it's a recursor, it's basing that decision on the fact that it asked the root servers for .local and the root servers responded that it doesn't exist. (Fun fact - this kind of query for an invalid TLD is a significant portion of the load on ...



Only top voted, non community-wiki answers of a minimum length are eligible