Ticket #472 (closed enhancement: fixed)
Quince to Puffin rsync script
Reported by: | chris | Owned by: | chris |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Live server | Keywords: | |
Cc: | ed, jim | Estimated Number of Hours: | 2.0 |
Add Hours to Ticket: | 0 | Billable?: | yes |
Total Hours: | 1.65 |
Description
Request from Jim:
"can you set up an rsync script on the new box that can:
- Grab all the files from sites/default/files on the old site recursively
- Exclude the directories 'ctools', 'js', 'css' and 'tmp' folders
- Put them in the /data/disk/[o1 OR tn depending on setup]/static/sites/transitionnetwork.org/files (make the folder)
- Be able to be run any time to bring this up to date, including deleting files that are gone and replacing all changed (except those in the ignored folders)
- Set the permissions and owners afterwards (I'll get the correct values for this afterwards, just leave a space in the script at the end)
If you can put this in /data/disk/[o1 OR tn depending on setup]/scripts/pull-files-from-quince.sh or similar then that would be awesome. This will allow us to get all the files from the other site whenever and will be useful many times, including when we finally do the go-live."
Change History
comment:1 Changed 4 years ago by chris
- Add Hours to Ticket changed from 0.0 to 1.4
- Status changed from new to closed
- Resolution set to fixed
- Total Hours changed from 0.0 to 1.4
comment:2 follow-up: ↓ 3 Changed 4 years ago by jim
- Add Hours to Ticket changed from 0.0 to 0.25
- Total Hours changed from 1.4 to 1.65
Thanks Chris.
FYI a couple of tweaks:
- DEST_DIR now is "/data/disk/tn/static/sites/transitionnetwork.org-PROD/files".
- RSYNC="rsync -az --delete" (use compression, don't be quiet [I like to see things happen!])
For some reason it still said nothing while it worked, but it did work! Thanks again.
comment:3 in reply to: ↑ 2 Changed 4 years ago by chris
Replying to jim:
- RSYNC="rsync -az --delete" (use compression, don't be quiet [I like to see things happen!])
For some reason it still said nothing while it worked, but it did work!
To see the output you need -va (v for verbose), compression isn't going to speed things up as both virtual servers are on the same switch, glad it worked :-)
This script has been created and tested, details follow.
Create a directory for the script and the script:
The directory /data/disk/tn/static currently has one file in it, EMPTY.txt with the content "empty" -- Jim should we delete this file when we create the /data/disk/tn/static/sites/transitionnetwork.org/files directory?
For the moment I have set the script up so that it writes the files into /tmp/ but of course this can be changed by editing the DEST_DIR variable.
Since there is 2.4G of files in /web/transitionnetwork.org/www/sites/default/files on quince I'd suggest moving the contents of /tmp/transitionnetwork.org/files to the place it's wanted to save time / resources compared with rsyncing the data from scratch.
Following is the content of the script: