Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Normally, on my website, files are either handled by WordPress or by me doing FTP.

I'd like to copy my entire site to a new folder. I don't want to copy it down to my local drive (with wget) and then just upload it. How close is this to the line I'd need (except near midnight)

 mv -r \fromfolder  \%todaysdate%

I've played with Unix and Linux for a few days over the years, but I'm a Windows (and DOS-prompt) guy. So, I don't know how to get to the server's command prompt on my 1and1-hosted site.

TIA

share|improve this question
    
It's going to be difficult if you can't get to the server's command line... –  Ignacio Vazquez-Abrams Nov 19 '10 at 19:19
    
That's part of my question. How does one get to the command line remotely on a Linux server hosted by 1and1.com. –  Robert Frank Nov 19 '10 at 19:30
    
Ok, I've figured how to login with putty to get a Debian prompt. So now the only question is what the mv command to copy a folder and subfolders to a new folder that has the time-date as part of its name. –  Robert Frank Nov 19 '10 at 19:53

1 Answer 1

up vote 2 down vote accepted

In your control center you should have a part where you can configure access. Among these options, there is FTP and also SSH. Configure SSH access, and log in. If you come via Windows, you have to have a SSH client. Putty is pretty much standard.

In your shell session, you've logged in to your home directory. Your move command is almost right, but you should use a path relative to your home (leave the initial slash away) and use forward slashes / instead of backslashes \. If you want to automatically generate a directory name with a date, you have to look into the basics of shell programming.

Experiment with this: mkdir "`date`" (that are quotes and backticks) and mv -r path/to/fromfolder path/to/tofolder

EDIT: Commenters are right, it should be noted that the date command between the backticks gets executed. Anything between the backticks will be executed and if it produces output, it will land there. And (of course), you should familiarize with the commands you use, for that (depending on how the host is configured) try: man date, info date and/or apropos date (and so on)

share|improve this answer
2  
It should be noted that backticks tell the shell to execute the commands in the backticks first, and then use the output in the commands place. –  Christoffer Madsen Nov 19 '10 at 20:41
1  
@Robert: Also, note that mv (no -r) will move the directory. If you want to copy it, use cp -a. –  Gilles Nov 19 '10 at 20:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.