1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Change all Subscription Expiry Dates at Once

Discussion in 'Plesk 10.x for Windows Issues, Fixes, How-To' started by WbAdminSupport, Feb 4, 2013.

  1. WbAdminSupport

    WbAdminSupport New Pleskian

    11
     
    Joined:
    Apr 26, 2012
    Messages:
    20
    Likes Received:
    0
    Hello,

    We currently have a bunch of domains, on both windows and Linux Plesk 10 platforms. These domains all have expiry dates set for various times.

    What I would like to do, is set all of these subscriptions for Unlimited. I have already adjusted the subscriptions themselves so future items will be set to Unlimited. However, I really would prefer to not have to go into each existing subscription and change its expiry date.

    Can someone explain how to do this?

    Thanks.
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,543
    Likes Received:
    1,240
    Location:
    Novosibirsk, Russia
    You can use something like this:

    for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/domain_pref -u $i -expiration 2020-12-30; done

    Modify it for Windows.
     
  3. WbAdminSupport

    WbAdminSupport New Pleskian

    11
     
    Joined:
    Apr 26, 2012
    Messages:
    20
    Likes Received:
    0
    Thanks IgorG.

    One quick question about converting to windows. Would I simply replace the "/etc/psa" and the "/usr/local/psa/bin/" paths with the relevant windows paths. IE: c:\plesk for example?
     
  4. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,543
    Likes Received:
    1,240
    Location:
    Novosibirsk, Russia
    Yes, but use Plesk admin's password instead of "\`cat /etc/psa/.psa.shadow\`". This command is just for getting admin's password from unix file /etc/psa/.psa.shadow
    And cycle, of course, should be written in Windows context. I'm not familiar with Windows scripting, unfortunately.
     
  5. WbAdminSupport

    WbAdminSupport New Pleskian

    11
     
    Joined:
    Apr 26, 2012
    Messages:
    20
    Likes Received:
    0
    Thanks so much for the help.
     
  6. BobCarter

    BobCarter New Pleskian

    10
     
    Joined:
    Feb 9, 2013
    Messages:
    1
    Likes Received:
    0
    Follow Up Question

    I just had a quick follow up question for the piece of code posted earlier. It works like a charm, but I noticed that when I go back into the "Customize" under the domain where I would have changed the subscription time to a date or unlimited instead of having the normal "OK" button it now says "Update & Lock".

    My question is is there a way to get this button back to just saying "OK"? I tried clicking on the "Update & Lock" button, which locks the account, and then used the "Unlock & Sync", but the button under "Customize" still says "Update & Lock".
     
Loading...